By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,856 Members | 2,164 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,856 IT Pros & Developers. It's quick & easy.

using currency in a stored procedure

P: 3
Dear SQL gurus,

I am so new at this, as a matter of fact this is my first Access Database front-end with a SQL back-end. I wrote a stored procedure to show liability for vacation accrued:

SELECT dbo.PS_PERSONAL_DATA.EMPLID, dbo.PS_PERSONAL_DATA.NAME, PS_PERSONAL_DATA_1.NAME AS SUPERVISOR_NAME, SUM(dbo.PS_JOB.HOURLY_RT * dbo.Vac_Accrued1.Total_Vac_Earned + dbo.Floater_Balance.Total_Floater_Balance) AS Liability
FROM dbo.Floater_Balance INNER JOIN
dbo.PS_JOB INNER JOIN
dbo.Vac_Accrued1 INNER JOIN
dbo.PS_EMPLOYMENT ON dbo.Vac_Accrued1.EMPLID = dbo.PS_EMPLOYMENT.EMPLID INNER JOIN
dbo.PS_PERSONAL_DATA ON dbo.Vac_Accrued1.EMPLID = dbo.PS_PERSONAL_DATA.EMPLID ON
dbo.PS_JOB.EMPLID = dbo.Vac_Accrued1.EMPLID INNER JOIN
dbo.PS_PERSONAL_DATA PS_PERSONAL_DATA_1 ON dbo.PS_EMPLOYMENT.SUPERVISOR_ID = PS_PERSONAL_DATA_1.EMPLID ON
dbo.Floater_Balance.EMPLID = dbo.Vac_Accrued1.EMPLID
GROUP BY dbo.PS_PERSONAL_DATA.EMPLID, dbo.PS_PERSONAL_DATA.NAME, dbo.PS_EMPLOYMENT.SUPERVISOR_ID, PS_PERSONAL_DATA_1.NAME


In the section where it is underlined there is a sum of several columns AS "Liability" I would like the total in Liability to be currency. How do I do that?

Any help would be greatly appreciated.

Lucinda
Dec 22 '09 #1
Share this Question
Share on Google+
1 Reply


ck9663
Expert 2.5K+
P: 2,878
Convert that portion to money...

Expand|Select|Wrap|Line Numbers
  1.  
  2. cast(SUM(dbo.PS_JOB.HOURLY_RT * dbo.Vac_Accrued1.Total_Vac_Earned + dbo.Floater_Balance.Total_Floater_Balance)  as money) as Liability
  3.  
  4.  
Happy Coding!!!

~CK
Dec 23 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.