Date Grouping on Reports

I

IreneJ

Hello,

I have a report with three subreports on it. All of them
run off queries with
a 'Form.frmPrintDialogueBox.txtBeginningDate'
and 'Form.frmPrintDialogueBox.txtEndingDate'to give them
the dates. On one of the subreports I have a count of
Appointments Booked i.e. for the period July 12-July 18
would be 101 appointments. I need to have another box
beside that one that will give me the count for the same
Appts field for the previous week i.e. July 05 - July 11,
2004.

Can anyone assist me.

Thanks so much,
IEJ
 
T

Terry

Irene,

A dcount function would work although (I believe) not the
most efficient function. Dcount(fieldname,recordsource)
You could include the date parameters in the dcount
function after the recordsource or in the criteria of your
query. Between Form.frmPrintDialogueBox.txtBeginningDate-7
and Form.frmPrintDialogueBox.txtEndingDate-7. Check help
for exact syntax.

HTH,

Terry
 
D

Duane Hookom

How about
=DCount("*","tblYourTable","[DateField] Between " &
DateAdd("D",-7,Forms!frm...txBeg...) & " And " & ...)
Place your form controls with dateadd in the expression.
 
G

Guest

Thank you, I'll give it a try.
IEJ
-----Original Message-----
How about
=DCount("*","tblYourTable","[DateField] Between " &
DateAdd("D",-7,Forms!frm...txBeg...) & " And " & ...)
Place your form controls with dateadd in the expression.

--
Duane Hookom
MS Access MVP


Hello,

I have a report with three subreports on it. All of them
run off queries with
a 'Form.frmPrintDialogueBox.txtBeginningDate'
and 'Form.frmPrintDialogueBox.txtEndingDate'to give them
the dates. On one of the subreports I have a count of
Appointments Booked i.e. for the period July 12-July 18
would be 101 appointments. I need to have another box
beside that one that will give me the count for the same
Appts field for the previous week i.e. July 05 - July 11,
2004.

Can anyone assist me.

Thanks so much,
IEJ


.
 
Top