Pulling data from date range query

M

Marcos

I would appreciate help on how to find the total number of “Yes†entries from
a query that already extracts all the records from a table based on a
BeginDate and EndDate. I need to then pull this total into a Report.

Although the following works for just pulling the total number out of all
“Yes†records in my table, it doesn’t work when using the date range:
Field: Welcome1Attn_Yes: Sum(IIf([Welcome1_Attention]="Yes",1,0))

Thanks much,
Marcos
 
J

John Spencer MVP

You need to add the date range as criteria also

Field: Welcome1Attn_Yes: Sum(IIf([Welcome1_Attention]="Yes" And [SomeField]
=[BeginDate] and [SomeField] <= [EndDate],1,0))


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
I would appreciate help on how to find the total number of “Yes†entries from
a query that already extracts all the records from a table based on a
BeginDate and EndDate. I need to then pull this total into a Report.

Although the following works for just pulling the total number out of all
“Yes†records in my table, it doesn’t work when using the date range:
Field: Welcome1Attn_Yes: Sum(IIf([Welcome1_Attention]="Yes",1,0))

Thanks much,
Marcos
 
D

Dela

WRITERS NEED TODAY

Write and earn good money by writing one article per day. Apply below by
clicking link.

http://www.bukisa.com/join/6233






John Spencer MVP said:
You need to add the date range as criteria also

Field: Welcome1Attn_Yes: Sum(IIf([Welcome1_Attention]="Yes" And
[SomeField]
=[BeginDate] and [SomeField] <= [EndDate],1,0))


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
I would appreciate help on how to find the total number of “Yes†entries
from a query that already extracts all the records from a table based on
a BeginDate and EndDate. I need to then pull this total into a Report.
Although the following works for just pulling the total number out of all
“Yes†records in my table, it doesn’t work when using the date range:
Field: Welcome1Attn_Yes: Sum(IIf([Welcome1_Attention]="Yes",1,0)) Thanks
much, Marcos
 

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