473,804 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using currency in a stored procedure

3 New Member
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_DAT A_1.NAME AS SUPERVISOR_NAME , SUM(dbo.PS_JOB. HOURLY_RT * dbo.Vac_Accrued 1.Total_Vac_Ear ned + dbo.Floater_Bal ance.Total_Floa ter_Balance) AS Liability
FROM dbo.Floater_Bal ance INNER JOIN
dbo.PS_JOB INNER JOIN
dbo.Vac_Accrued 1 INNER JOIN
dbo.PS_EMPLOYME NT ON dbo.Vac_Accrued 1.EMPLID = dbo.PS_EMPLOYME NT.EMPLID INNER JOIN
dbo.PS_PERSONAL _DATA ON dbo.Vac_Accrued 1.EMPLID = dbo.PS_PERSONAL _DATA.EMPLID ON
dbo.PS_JOB.EMPL ID = dbo.Vac_Accrued 1.EMPLID INNER JOIN
dbo.PS_PERSONAL _DATA PS_PERSONAL_DAT A_1 ON dbo.PS_EMPLOYME NT.SUPERVISOR_I D = PS_PERSONAL_DAT A_1.EMPLID ON
dbo.Floater_Bal ance.EMPLID = dbo.Vac_Accrued 1.EMPLID
GROUP BY dbo.PS_PERSONAL _DATA.EMPLID, dbo.PS_PERSONAL _DATA.NAME, dbo.PS_EMPLOYME NT.SUPERVISOR_I D, PS_PERSONAL_DAT A_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 1530
ck9663
2,878 Recognized Expert Specialist
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
5446
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 this error message: "The Error Message was: Error detected by database DLL.from: Crystal Reports ActiveX Designer". What am I doing wrong in the SubReport section below and how do I properly pass in sproc params to the subreport? Thanks. ...
0
6707
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 Visual Basic .NET version of this article, see 308049. For a Microsoft Visual C++ .NET version of this article, see 310071. For a Microsoft Visual J# .NET version of this article, see 320627. This article refers to the following Microsoft .NET...
4
13473
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 not work. I've been trying to get this to work with converting the UDF to a procedure, but I'm having no luck. Here is the background on what I'm trying to accomplish. I need to perform a sub-identity on a table, I have the normal identity set,...
2
9249
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 problems doing this. I wanted to implemented a generic "Helper" class like this: /** * Helper
0
2657
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 to call them from an ASP.Net page Every modern database system has a stored procedure language. SQL Server is no different and has a relatively sophisticated and easy to use system. This article will not attempt to go into depth in explaining...
1
13673
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 procedure============= Create PROCEDURE get_timedout_scripts (
1
2435
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 another stored procedure and use the outcome of that stored procedure to update the record in table Y. I have this stored procedure (stA) CREATE PROCEDURE procstA (@SSNum varchar(9) = NULL) AS
9
3881
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 vargraphic input parameters along the following lines in i_vargraphic100 vargraphic(100) and they are populated from String's in java.
0
23191
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 must pass exactly 3 Arguments which should be of the specific Data Type and in the correct order as defined by the Procedure itself. A simple case will illustrate this point: Public Function fCalculateInterest(curPrincipal As Currency, sngRate As...
0
9594
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10350
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10351
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9174
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6866
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3834
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.