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
 General SQL Server Forums
 New to SQL Server Programming
 Update datetime field - SQL Server 2005

Author  Topic 

paramu
Posting Yak Master

151 Posts

Posted - 2009-03-28 : 06:46:43
Iam looking to use the following command in SQL-Server 2005

update emp_details set join_dt='03/28/2007' where emp_id='1700'

PS:join_dt is datetime field

Thanks & Helps are appreciated



Paramu @ PARANTHAMAN

paramu
Posting Yak Master

151 Posts

Posted - 2009-03-28 : 08:31:51
It has to be
update emp_details set join_dt='2007-03-28' where emp_id='1700'



Paramu @ PARANTHAMAN
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-29 : 03:40:38
quote:
Originally posted by paramu

It has to be
update emp_details set join_dt='2007-03-28' where emp_id='1700'



Paramu @ PARANTHAMAN


this is the safest way. always use iso format yyyy-mm-dd for passing date values. It always interprets format based on regional settings other ways (dd/mm/yyyy ,mm/dd/yyyy,... depending on whether settings is UK,US,..)
Go to Top of Page
   

- Advertisement -