Hi everybody!
I have a problem when i am trying to cast to a date in a prepared statement sentence.
My sql sentence part is:
|| ' WHERE '
|| ' CAST(CAST(YEAR( FH1)) AS VARCHAR(4))'
|| '-'
|| 'CAST (MONTH(FH1) AS VARCHAR(2))'
|| '-'
|| '01 AS DATE)'
|| ' >= CURRENT DATE '
And give me the error that i cannot use the - .
Any ideas to solve the problem?
Thanks.
I have a problem when i am trying to cast to a date in a prepared statement sentence.
My sql sentence part is:
|| ' WHERE '
|| ' CAST(CAST(YEAR( FH1)) AS VARCHAR(4))'
|| '-'
|| 'CAST (MONTH(FH1) AS VARCHAR(2))'
|| '-'
|| '01 AS DATE)'
|| ' >= CURRENT DATE '
And give me the error that i cannot use the - .
Any ideas to solve the problem?
Thanks.