How to seperate Date and Time in SQL
-
Hi All, Greetings...i have a doubt...i've to separate date and time in sql table..its displaying both date and time...can any one tell me the query for that... Thanks in Advance
Babu
-
Hi All, Greetings...i have a doubt...i've to separate date and time in sql table..its displaying both date and time...can any one tell me the query for that... Thanks in Advance
Babu
select datepart(year,timestamp) + '/' + datepart(month,timestamp) + "'/' + datepart(day,timestamp) as date,datepart(hour,timestamp) + ':' + datepart(minute,timestamp) + ':' + datepart(second,timestamp) as time from sometable
Fairly simple using the datepart function. Be adviced: The result is a string but you can convert it back to a datetime type.WM.
What about weapons of mass-construction? -
Hi All, Greetings...i have a doubt...i've to separate date and time in sql table..its displaying both date and time...can any one tell me the query for that... Thanks in Advance
Babu
-
Hi All, Greetings...i have a doubt...i've to separate date and time in sql table..its displaying both date and time...can any one tell me the query for that... Thanks in Advance
Babu
-
this SQL code takes current date and time of ur PC
select substring(cast(getdate()as varchar),1,11) as datte, substring(cast(getdate()as varchar),14,8) as ttime
Thnaks it is useful for me
Regards, Jayamaruthi.A
-
Thnaks it is useful for me
Regards, Jayamaruthi.A