I'm hitting error while running this statement in sql server..
DECIMAL(TO_CHAR(CURRENT TIMESTAMP -1 DAYS,'yyyymmdd')8,0)
I'm hitting error while running this statement in sql server..
DECIMAL(TO_CHAR(CURRENT TIMESTAMP -1 DAYS,'yyyymmdd')8,0)
For MSSQL
it's CURRENT_TIMESTAMP
, you forgot the underscore. I'm not sure what you're trying to accomplish with TO_CHAR
... But that's not the only problem with this syntax. You're mixing together a lot of different RDBMS's here...
I'm just guessing what you're trying to do but this seems to be what you're looking for:
SELECT CAST(DATEADD(DD, -1, CURRENT_TIMESTAMP) AS DECIMAL(8, 0))