Hi Experts,
I am trying to convert an input column coming as varchar to Date format.
The input is coming in the format "mm/dd/yy 00:00:0"
I have used the combination of below functions in transformer.
StringToDate(Convert( "0:00:00","", LNK_XFRM_REAL_EST_STORES_DM.store_open_date) ,"%mm-%dd-%yyyy")
and I am getting the column as ******* in peek stage.
And when I am trying to load the database (Netezza) I am gettng the error
main_program: Fatal Error: Added field has duplicate identifier():
I have tried out all possible methods.. Can somebody help me out to get around this.. ?
Thanks in Advance.
Problem in String to Date conversion
Moderators: chulett, rschirm, roy
Problem in String to Date conversion
- Jaysheel -
Code: Select all
StringToDate(LNK_XFRM_REAL_EST_STORES_DM.store_open_date[1,8] ,"%mm/%dd/%yyyy")
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
In your case, year is actually two characters long. It should be "yy" rather than "yyyy"
Code: Select all
StringToDate(LNK_XFRM_REAL_EST_STORES_DM.store_open_date[1,8],"%mm/%dd/%yy")
The format needs to be that of the source, I should have caught the 4 digit error, sorry. You can then choose your display options for the date elsewhere to display 4 digits.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>