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'