October 28, 2009 at 12:21 pm
my current time format for a column
regdate is
2004-01-20 10:09:18.000
2005-02-15 20:09:10.000
2006-03-17 21:09:18.000
My result should be in this format
01/20/2004 10:09:18 AM
02/15/2005 08:09:10 PM
03/17/2006 09:09:18 PM
Thanks
October 28, 2009 at 12:35 pm
Need to ask why? Presentation of datetime values should be handled by the UI.
October 28, 2009 at 2:15 pm
I asked since UI is not an option as far as I am concerned.
Thanks
October 28, 2009 at 2:24 pm
There is no such thing as time formatting in database.
Datetime values are stored as 8 bytes float values.
The way they are displayed depends on UI application and only on UI application.
Open the same table with datetime values in QA and EM and see the difference.
_____________
Code for TallyGenerator
October 28, 2009 at 2:52 pm
sql2000-915039 (10/28/2009)
I asked since UI is not an option as far as I am concerned.Thanks
Why?
October 28, 2009 at 3:13 pm
This should really be handled by your user interface.
Since you state that is not an option, I guess you will be exporting sql data using query analyser or bcp.
In that case you'll have to reside to the convert function (to be applied on all datetime columns of your table).
Have a look at BOL: http://msdn.microsoft.com/en-us/library/aa226054%28SQL.80%29.aspx
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply