I have some code where the data is getting converted CDbl in Access but I am rewriting it in SQL and can't figure out what to put in place of it. The code in MS-Access reads:
(CASE
WHEN EMP_TNG_RL_CD = 'ST'
THEN [CountOfEMP_TNG_STT_DT] * CDbl([Length])
ELSE 0
END) AS ST_HOURS_SUM
In SQL Server you can use:
CASE
WHEN EMP_TNG_RL_CD = 'ST'
THEN [CountOfEMP_TNG_STT_DT] * cast([Length] as float)
ELSE 0
END AS ST_HOURS_SUM
See a list of data types in SQL Server
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With