Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 datetime in sqlserver 2005

Author  Topic 

randheer
Starting Member

15 Posts

Posted - 2008-11-04 : 07:10:30
I have a table of employees with date of birth column in it. I want to add constraint to prevent insertion of current date in the dateofbirth column.
My table is created and data is inserted.But now i want to seprate the date and time in the column of dateofbirth as time is also inserted.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-04 : 07:36:36
seperate? you mean strip in selects? or store as a new field in db?
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-11-04 : 08:22:53
To omit time part, use

DATEADD(DAY,DATEDIFF(DAY,0,Date_value),0)

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -