Hi
SET @frDate= "01/04" + (CASE WHEN (MONTH(GetDate())) <=3 THEN convert(varchar(4),
YEAR(getDate())-1) else "01/04" + convert(varchar(4),YEAR(getDate()) End
Thanks
Hi
SET @frDate= "01/04" + (CASE WHEN (MONTH(GetDate())) <=3 THEN convert(varchar(4),
YEAR(getDate())-1) else "01/04" + convert(varchar(4),YEAR(getDate()) End
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vishal JoshiPosted Feb 1, 2024, 6:31 AM
Hello Ramco,
Please try the below code. it's not working due to closing bracket is missing ')'
Thanks
Tuhin PaulPosted Feb 2, 2024, 2:57 PM
Replaced double quotes with single quotes for string literals.
Sachin SinghPosted Feb 1, 2024, 6:34 AM
Check this
Jayraj ChhayaPosted Feb 1, 2024, 6:27 AM
The syntax error is caused by the incorrect usage of double quotes (
") instead of single quotes (') to enclose the string literals in the code. In SQL, string literals should be enclosed in single quotes.By replacing the double quotes with single quotes, the syntax error is resolved.