Query Sums by date and client restriction

V

VADIMBAR

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
 
D

Duane Hookom

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.
 
V

Vadimbar

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
 
D

Duane Hookom

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top