I'm trying to use StringToDate and generating the followin error message :- 'Conversion error calling conversion routine date_from_string data may have been lost'.
The format is - StringToDate(trim(svTermDate2,' ','A'),"%yyyy-%mm-%dd")
svTermDate2 = svTermDateYYYYMinus1:"-":svTermDateMM:"-":svTermDateDD
svTermDateYYYYMinus1 = YearFromDate(TimestampToDate(T1_Input.TERM_END_DATE)) -1
svTermDateMonth = MonthFromDate(TimestampToDate(T1_Input.TERM_END_DATE))
svTermDateDay= MonthDayFromDate (TimestampToDate (T1_Input.TERM_END_DATE))
svTermDateMM = str('0',2 - len(svTermDateMonth)):svTermDateMonth
svTermdateDD = str('0',2 - len(svTermDateDay)):svTermDateDay
I'm using the str function to add leading 0's to the month and day values output from the MonthFromDate and MonthDayFromDate functions.
When i view the value contained in svTermDate2 as part of an output dataset it looks OK even though the warning message is generated.
StringToDate
Moderators: chulett, rschirm, roy
How many rows are you sending through and how many warning messages are you getting? Refine your input until you can work out which record is giving the warning.
Then send all your stage variables to an output stream (concatenate within quotes or brackets so you can see the full string of each). If issue still not obvious, post your source and stage variable values here.
Then send all your stage variables to an output stream (concatenate within quotes or brackets so you can see the full string of each). If issue still not obvious, post your source and stage variable values here.