Query Sums by date and client restriction

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, I am trying to run a total [page]*[quantity] count:
Totals: (Sum(([tbl_GovTrack]![Quantity]*[tbl_GovTrack]![Pages])))

This returns the [Page]*[Quantity] to Totals

My [datestamp] has the following:
Between [EnterStartDate] And [EnterStopDate]

I need the total for client A:
A 12*1==>12
A 12*12==>144
A 11*2==>22

I get the totals for each line item but I can't get the total for all "A" clients specified by date Range.
I need "A"==>178 one line answer.

Thank you in advance
 
SELECT Sum([Quantity]*[Pages]) as Totals
FROM tblYourTable
WHERE Client = "A" and DateStamp Between [EnterStartDate] And
[EnterStopDate];

--
Duane Hookom
MS Access MVP


VADIMBAR said:
Hello, I am trying to run a total [page]*[quantity] count:
Totals: (Sum(([tbl_GovTrack]![Quantity]*[tbl_GovTrack]![Pages])))

This returns the [Page]*[Quantity] to Totals

My [datestamp] has the following:
Between [EnterStartDate] And [EnterStopDate]

I need the total for client A:
A 12*1==>12
A 12*12==>144
A 11*2==>22

I get the totals for each line item but I can't get the total for all "A"
clients specified by date Range.
 
Excellent thank you. If my Client is a variable that needs user intervention? do I use:
SELECT Sum([Quantity]*[Pages]) as Totals
FROM tblYourTable
WHERE Client = ([Enter client Name] &"*") and DateStamp Between [EnterStartDate] And
[EnterStopDate];




Duane Hookom said:
SELECT Sum([Quantity]*[Pages]) as Totals
FROM tblYourTable
WHERE Client = "A" and DateStamp Between [EnterStartDate] And
[EnterStopDate];

--
Duane Hookom
MS Access MVP


VADIMBAR said:
Hello, I am trying to run a total [page]*[quantity] count:
Totals: (Sum(([tbl_GovTrack]![Quantity]*[tbl_GovTrack]![Pages])))

This returns the [Page]*[Quantity] to Totals

My [datestamp] has the following:
Between [EnterStartDate] And [EnterStopDate]

I need the total for client A:
A 12*1==>12
A 12*12==>144
A 11*2==>22

I get the totals for each line item but I can't get the total for all "A"
clients specified by date Range.
I need "A"==>178 one line answer.

Thank you in advance
 
I don't ever use parameter queries however yours should work. A much better
method is to use controls on forms in place of parameters.

--
Duane Hookom
MS Access MVP


Vadimbar said:
Excellent thank you. If my Client is a variable that needs user intervention? do I use:
SELECT Sum([Quantity]*[Pages]) as Totals
FROM tblYourTable
WHERE Client = ([Enter client Name] &"*") and DateStamp Between [EnterStartDate] And
[EnterStopDate];




Duane Hookom said:
SELECT Sum([Quantity]*[Pages]) as Totals
FROM tblYourTable
WHERE Client = "A" and DateStamp Between [EnterStartDate] And
[EnterStopDate];

--
Duane Hookom
MS Access MVP


VADIMBAR said:
Hello, I am trying to run a total [page]*[quantity] count:
Totals: (Sum(([tbl_GovTrack]![Quantity]*[tbl_GovTrack]![Pages])))

This returns the [Page]*[Quantity] to Totals

My [datestamp] has the following:
Between [EnterStartDate] And [EnterStopDate]

I need the total for client A:
A 12*1==>12
A 12*12==>144
A 11*2==>22

I get the totals for each line item but I can't get the total for all
"A"
clients specified by date Range.
I need "A"==>178 one line answer.

Thank you in advance
 
Back
Top