kengooch
Member
- Local time
- Today, 10:40
- Joined
- Feb 29, 2012
- Messages
- 137
I have a From that shows a quick list of totals for various aspects of Patient data Table and it's child records. See image below.
They are asking now to be able to filter these totals by month or by quarter, and by Pathologist. So my thought is to provide a start and end date and tally the values that meet the criteria of the data range using an AND function to tie that two the dates in the vDateSt and vDateEnd and the vPathologist unbound text boxes. When the user clicks the Run Report button, it sets that filter and recalculates totals based upon the dates and pathologists. If not dates are selected and no pathologist selected, or if dates are selected and no pathologist is selected or if pathologist are selected and no dates, they want the numbers to be correct for those combinations.
The Unbound Text boxes that currently tally records are reading data from the Accession Log (tAccLog) and doing a simple DCount function. The equation I use in the Total Count box is.
So my thinking is that I can modify that equation... I have tried many combinations... Here is my last attempt...
I use the "Between IIF(IsNull([vDatest]) string' in a query that prompts the user and it works perfectly, but the syntax is not working in my unbound text box.
Thanks in advance for your help!
They are asking now to be able to filter these totals by month or by quarter, and by Pathologist. So my thought is to provide a start and end date and tally the values that meet the criteria of the data range using an AND function to tie that two the dates in the vDateSt and vDateEnd and the vPathologist unbound text boxes. When the user clicks the Run Report button, it sets that filter and recalculates totals based upon the dates and pathologists. If not dates are selected and no pathologist selected, or if dates are selected and no pathologist is selected or if pathologist are selected and no dates, they want the numbers to be correct for those combinations.
The Unbound Text boxes that currently tally records are reading data from the Accession Log (tAccLog) and doing a simple DCount function. The equation I use in the Total Count box is.
Code:
=DCount("*","tAccLog","tSpecCode =22")
So my thinking is that I can modify that equation... I have tried many combinations... Here is my last attempt...
Code:
=DCount("*",tAccLog","tSpecCode =22 and Between (IIf(IsNull([vDateSt]),#1/1/1900#,[vDateSt])) And (IIf(IsNull([vDateEnd]),#12/31/3100#,[vDateEnd])) and tPathologist =4")
I use the "Between IIF(IsNull([vDatest]) string' in a query that prompts the user and it works perfectly, but the syntax is not working in my unbound text box.
Thanks in advance for your help!