Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Summing record from two tables
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Summing record from two tables

 Post Reply Post Reply
Author
trafmore View Drop Down
Newbie
Newbie


Joined: 13 May 2009
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote trafmore Quote  Post ReplyReply Direct Link To This Post Topic: Summing record from two tables
    Posted: 13 May 2009 at 7:54pm
Hi everyone I am here to seek help. Here is my issue, I have two table that I creating a quarterly report from using ASP .net.  The table 1 holds records of every month and table 2 has a single quarterly record  of some other data. I have a Dropdown List from which the user selects the quarter from. I want when the user select second,third and fourth quarters that the report  get the sum of all the records up to that quarter in table 2 and the single record from table 1 for that selected quarter for each peson. Here is a look of what I have done but it does not give me what I want.

select FirstName + ' ' + LastName As EName,A.Vacation,A.Sick,A.AT, sum(Convert(decimal(10,2),Hours_Vac)) as VacUse,

sum(Convert(decimal(10,2),Hours_Sick)) as SickUse, SUM(CAST(SickOccur AS INT)) as SickOccur,

sum(Convert(decimal(10,2),HoursOT)) as HOT, sum(Convert(decimal(10,2),HoursAT)) as HAT From vwVacations AS V ,Quarterly_Balance AS A

Where V.IBMNum = A.IBMNum And V.Quater = A.Quarter And V.Yr = A.Yr and (Quater = 'First'

Back to Top
scottage View Drop Down
Newbie
Newbie


Joined: 20 August 2004
Location: United Kingdom
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote scottage Quote  Post ReplyReply Direct Link To This Post Posted: 15 June 2009 at 1:21pm
Hi trafmore, I think that we'll need some more information to go on here.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.