October 25, 2010 at 5:04 am
I have a date fields and I want to separate the time and date for a field contains just the date and other fields contains the time
exemple :
fc_date
--------
14/12/2004 15:34:00
get this
fc_date fc_time
-------- -------
14/12/2004 15:34:00
October 25, 2010 at 5:33 am
Try these:
select CONVERT ( date , '12-14-2004 15:34:00')
select CONVERT ( time , '12-14-2004 15:34:00')
But, why would you want to do it ? Store dates fully!
October 25, 2010 at 5:36 am
If this is for display purposes, fine. If this is for storage please reconsider, it will just make things harder to work with.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 25, 2010 at 5:38 am
thanks:-)
October 25, 2010 at 6:21 am
This was removed by the editor as SPAM
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply