Hi,
I have the below SQL query in Creports. It is throwing an error " Conversion failed when converting datetime from character string".
Declare @Get_Date datetime, @StartDate Varchar(30)
select @StartDate = '{?StartDate}'
Select @Get_Date = convert(varchar ,month(Getdate()) )+ '/01/' +convert(varchar, year(Getdate()))
Select @Get_Date = dateadd(m,datediff(m,0, convert(datetime,@StartDate) ),0)
I think I am missing something. Any ideas?
Thanks,
Petronas
I have the below SQL query in Creports. It is throwing an error " Conversion failed when converting datetime from character string".
Declare @Get_Date datetime, @StartDate Varchar(30)
select @StartDate = '{?StartDate}'
Select @Get_Date = convert(varchar ,month(Getdate()) )+ '/01/' +convert(varchar, year(Getdate()))
Select @Get_Date = dateadd(m,datediff(m,0, convert(datetime,@StartDate) ),0)
I think I am missing something. Any ideas?
Thanks,
Petronas