flstffatboy
Technical User
- Sep 19, 2002
- 84
Hello,
I'm getting the following error when running this code within a SQL Server 2000 job. There code runs fine within query analyzer. Could anyone shed any light on this?
Error - "Syntax error converting datetime from character string. [SQLSTATE 22007] (Error 241). The step failed."
Code below:
declare @PLine as Varchar(3)
declare @BegDt as datetime
declare @EndDt as datetime
set @PLine = '230'
set @BegDt = (select "Period Start Date Month"
from cognos.dbo.Fydates2
where datediff(day, "Date",getdate()) = 1)
set @EndDt = getdate()
"Period Start Date Month" and "Date" fields are both a smalldatetime
Thanks,
FLSTF
I'm getting the following error when running this code within a SQL Server 2000 job. There code runs fine within query analyzer. Could anyone shed any light on this?
Error - "Syntax error converting datetime from character string. [SQLSTATE 22007] (Error 241). The step failed."
Code below:
declare @PLine as Varchar(3)
declare @BegDt as datetime
declare @EndDt as datetime
set @PLine = '230'
set @BegDt = (select "Period Start Date Month"
from cognos.dbo.Fydates2
where datediff(day, "Date",getdate()) = 1)
set @EndDt = getdate()
"Period Start Date Month" and "Date" fields are both a smalldatetime
Thanks,
FLSTF