1) Your format string does NOT match the format of your timestamp string (I do not see dashes in the source)
2) You're attempting to process a timestamp string with a date function and format.
With StringToDate() and StringToTimestamp(), the format string tells the function what all the various parts of the source string should be. If you have a dash/slash/period/etc. in the format string, it needs to be in your incoming data.
Are you trying to process a timestamp (date+time) or just a date? If the former, use StringToTimestamp() with the proper format string. If the latter, you need to isolate just the date portion of the string to pass to StringToDate()--the Left() function would work well here, or a substring.
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
@jwiles, i am trying to process it to a date.
I used the left function to cut out the date alone and then i passed it to the StringToDate also.. Even then, i am getting the same error...
Not sure why U (one of our posters) would do this and a couple of issue here as well. One is that you are missing the format mask that the function needs. The other is that there's really no need to substring your source and introduce a delimiter when all you have to do is provide a proper mask that matches the incoming format.
-craig
"You can never have too many knives" -- Logan Nine Fingers
Yes, %yyyy%mm%dd solved the issue... it did not occured to me that it is the input format and not the output format required as i thought...
Thanks for your help guys.. you ppl Rock!!!!!!!!!!!!
It's an all too common mistake. You need to realize there is no "output format" for a Date field... a date is a date is a date and it is stored in an internal/binary format. Only people readable external representations like in your string need a "format".
-craig
"You can never have too many knives" -- Logan Nine Fingers