Click to See Complete Forum and Search --> : stoing date (date only not time with date) and time seperately in SQL server


marinajogy
August 25th, 2008, 04:23 AM
Hi
I am using SQL server 2000.
I want store date (date only not time with date) and time seperately
in a table, also want to searchers based on these fileds.

ex: select * from tablename where datefield>10/12/2008 and timefield>12:30 - assume time in 24 hour format

thnaks in advance

Alsvha
August 25th, 2008, 04:45 AM
Mind if I ask why?

davide++
August 25th, 2008, 06:52 AM
Hi all.

I don't know SQLServer, but I think there're some functions to manage the dates, so you can extract the date part and the time part from a date before inserting the rows. See the documentation.

But I agree with Alsvha, usually there are no good reasons to store date and time separately.