Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access Equivalents in SQL

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
like image 943
user1958651 Avatar asked Nov 19 '25 17:11

user1958651


1 Answers

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

like image 137
Taryn Avatar answered Nov 22 '25 05:11

Taryn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!