on 12-27-2007 1:10 PM
Hi Friend
I have a String like 20071212 that I want to convert to datetime format.
I have converted it like 2007-12-12T00:00:00. but that is string type. I want it as a Datetime format.
How can I do this
Thanks
Siddhartha P
Hi Siddhartha,
After playing around a bit, I found that if you take the date string and apply the datetoxmlformat function you can then assign the result to a property of datetime and the result is sql data type 93 (datetime). Hope this helps.
Kind Regards,
Diana Hoppe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Siddhartha,
In BLS use the datetoxmlformat function like this...
datetoxmlformat("20071212", "yyyyMMdd")
Which is what you have probably done; the actual datatype is specified in the XML. The actual SQLDataType is in the XML column declaration as an attribute, with a value of 93. You probably have it defined as type 1 which is a string.
Please refer to the help documentation for more details...
Sam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
" I have converted it like 2007-12-12T00:00:00. but that is string type. I want it as a Datetime format"
The type that you've mentioned above is not string but the dateTime representation in XML . I think you have done the correct conversion but somehow getting confused with the representation.
Moreover the function Sam's mentioned would get you the same result as well.You say you get an error, where? when?Is it when you use the function Sam's mentioned or anywhere else?Give the details.
User | Count |
---|---|
11 | |
6 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.