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
 SQL Server Administration (2005)
 Update Query not working

Author  Topic 

sunny_10
Yak Posting Veteran

72 Posts

Posted - 2014-11-12 : 04:28:19
Hi

In the below query it is giving me error
Conversion failed when converting the varchar value '/' to data type int.

u_dates is Date Field. U_years & U_Months are integer type

update [@HISTORY] set u_dates = U_years + '/' + U_months + '/01'

Thanks

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-11-12 : 07:12:28
Set u_dates = dateadd(year, u_years-1900, dateadd(month, u_month-1,0))
Go to Top of Page
   

- Advertisement -