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.
Author |
Topic |
chetanb3
Yak Posting Veteran
52 Posts |
Posted - 2011-01-24 : 09:08:30
|
I have a sql server Job executing the Store procedure containg below code DECLARE @LastSunday DateTime select @LastSunday = Convert(varchar(10),DATEADD(wk, DATEDIFF(wk,0,GETDATE()), 6),120) job fail to execuete giving error The conversion of a char data type to a datetime data type resulted in an out-of-range datetime valuebut the same store procedure works fin when executed in query analyserI guess this could be bacause of the server date format might be different then the code? |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-01-24 : 09:10:57
|
DECLARE @LastSunday DateTimeselect @LastSunday = DATEADD(wk, DATEDIFF(wk,0,GETDATE()), 6) select @LastSundayMadhivananFailing to plan is Planning to fail |
 |
|
chetanb3
Yak Posting Veteran
52 Posts |
Posted - 2011-01-24 : 09:33:33
|
Thanks, I it is working under job now |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-01-24 : 09:47:38
|
quote: Originally posted by chetanb3 Thanks, I it is working under job now
You are welcome MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|