Query Calculation

Tom Vert

New Member
Joined
Oct 30, 2004
Messages
43
I’m working with a form based on a query. Among others, my table has two date fields: DateIn and DateOut. The query counts the number of records with a DateIn of <=15 days from today’s date. Expression is: <=15: Count(IIf([DAYS]<=15,"1")). “DAYS” is calculated using the DateDiff function.

In a calculated control on the form, I’m trying to count the number of records with a DateIn, but no DateOut, using: =Sum(IIf([<=15] And IsNull([DateOut]),"1")) as the control source.

If works fine, but when the query counts two or more occurrences with the same DateIn, my form will only count one occurrence. Is there a work around for this? Thanks.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi
Can you do the second count in the query instead of on the form?
Andrew
 
Upvote 0

Forum statistics

Threads
1,214,424
Messages
6,119,407
Members
448,894
Latest member
spenstar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top