Question : getdate ()

I am trying to setup a snapshot table which has an archive of data that we can look back on over time. I have created a table and an insert routine that does exactly what we want except I am using the getdate() to input todays date. As you know getdate() puts the date into SQL in the following format:- 2005-05-04 09:34:02.397 I need it to put only the date part not the time ie. 2005-05-04 can this be done?

Answer : getdate ()

try CONVERT(CHAR(8),GETDATE(),10)
Random Solutions  
 
programming4us programming4us