473,386 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

using currency in a stored procedure

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
1 1516
ck9663
2,878 Expert 2GB
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

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

Similar topics

0
by: Aaron | last post by:
The following code works fine when previewing a Crystal report using ASP, EXCEPT when it gets to a report using a SubReport and its associated parameters. The whole report just comes up blank with...
0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
4
by: marc | last post by:
I've been developing a stored procedure that uses a user defined function in the query portion of the procedure. However, since the end product needs to allow for dynamic table names, the UDF will...
2
by: Kent Lewandowski | last post by:
hi all, Recently I wrote some stored procedures using java jdbc code (admittedly my first stab) and then tried to implement the same within java packages (for code reuse). I encountered...
0
by: Amber | last post by:
Stored procedures are faster and more efficient than in-line SQL statements. In this article we will look at two SQL Server stored procedures; one using an input parameter and one not, and see how...
1
by: deepdata | last post by:
Hi, I am trying to fetch data from db2 (express version) database by calling stored procedure. I have tried to use both cursor and for loop but still i am getting error. --======Start...
1
by: ILCSP | last post by:
Hello, I'm trying to accomplish 3 things with one stored procedure. I'm trying to search for a record in table X, use the outcome of that search to insert another record in table Y and then exec...
9
by: weirdwoolly | last post by:
Hopefully someone will be able to help. I have written a stored procedure in C++ called from a Java test harness to validate the graphic data types in C++ and their use. I have declared the...
0
ADezii
by: ADezii | last post by:
Generally, the number of Arguments in a Procedure Call must be the same as in the Procedure Specification. If a Procedure requires 3 Arguments in its Specification, when calling the Procedure you...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.