amukta
asked on
Date conversion from mm/dd/yyyy to yyyymmdd in sqlserver 2005
Hi!
I need convert date in the format mm/dd/yyyy to yyyymmdd
and also mm/dd/yy to yyyymmdd format.I'm not able to find an appropriate solution for that.
Also how do I convert time in the format hh:mm:ss.xxx(xxx represent milli seconds)
to hh:mm:ss:xxxx .
How do I convert time in the format hhmmssx to hh:mm:ss:xxx?
How do I convert time in the format hh:mm:ss.xxx to hh:mm:ss?
How do I convert time in the format hh:mm:ss to hhmmss?
All of these in sql server 2005.
can I get the code if possible?
Please let me know ASAP.
Thanks in advance
I need convert date in the format mm/dd/yyyy to yyyymmdd
and also mm/dd/yy to yyyymmdd format.I'm not able to find an appropriate solution for that.
Also how do I convert time in the format hh:mm:ss.xxx(xxx represent milli seconds)
to hh:mm:ss:xxxx .
How do I convert time in the format hhmmssx to hh:mm:ss:xxx?
How do I convert time in the format hh:mm:ss.xxx to hh:mm:ss?
How do I convert time in the format hh:mm:ss to hhmmss?
All of these in sql server 2005.
can I get the code if possible?
Please let me know ASAP.
Thanks in advance
You actually want to change what they are **stored as** or how they are formatted when you select them?
Datetime and smalldatetime are not stored in any regional format. In order to convert for display purposes to some typical formats, take a look at the CONVERT() function in BOL
Use the Convert function in SQL to convert the date format according to your choice.
You can specify the <Style> tag according to your choice.
For eg:- convert (datetime, <Column Name>, 112 ) will give you the format yyyymmdd
Like wise you can get different formats.
You can specify the <Style> tag according to your choice.
For eg:- convert (datetime, <Column Name>, 112 ) will give you the format yyyymmdd
Like wise you can get different formats.
ASKER
Hi! Doc McAlister,
I want to change the formatwhile selecting them.
Thanks,
Amukta
I want to change the formatwhile selecting them.
Thanks,
Amukta
ASKER
Hi! ursangel,
Unable to do it with the solutio u've sent me, for soem reason.
Is there any other alternative.
Thanks,
Unable to do it with the solutio u've sent me, for soem reason.
Is there any other alternative.
Thanks,
>>Unable to do it with the solutio u've sent me, for soem reason.<<
Try posting your query and we can be more specific.
>>Is there any other alternative.<<
There is no other alternative with T-SQL.
Try posting your query and we can be more specific.
>>Is there any other alternative.<<
There is no other alternative with T-SQL.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.