Originally Posted by
ItsMe
I did not understand that it was throwing an error on that line. It is missing the = operator. Another issue with it is the dates are missing the # qualifiers. I thought I would try it without first and use variables of data type Date but, it is a no go. So here, this is tested.
Code:
strWhere = "[MyDateField] BETWEEN #" & dtStart1 & "# AND #" & dtEnd1 & "# Or [MyDateField] BETWEEN #" & dtStart2 & "# AND #" & dtEnd2 & "#"
Thanks, it works!
Now, I don't know how to build a report from a form. I am looking for a tutorial.
Without the date between filter, the query I used to generate the report is as follow:
Code:
SELECT TRACKING.DET AS DET_CODE,
Count( TRACKING.DET ) AS TOTAL_DET,
Sum( TRACKING.Savings ) AS TOTAL_SAV_CODE
FROM TRACKING
WHERE ( ( ( TRACKING.[Date of Service] ) IS NOT NULL )
AND
( ( TRACKING.DET ) IN ( 10, 11, 12, 13, 14 ) ) )
GROUP BY TRACKING.DET;
I am looking for my report to do this:
From [dtStart1] to [dtEnd1]
DET_CODE |
TOTAL_DET |
TOTAL_SAV_CODE |
10 |
500 |
6,000.00 |
11 |
401 |
5,000.00 |
12 |
5 |
1,000.00 |
13 |
15 |
0.00 |
14 |
500 |
20,000.00 |
From [dtStart2] to [dtEnd2]
DET_CODE |
TOTAL_DET |
TOTAL_SAV_CODE |
10 |
100 |
6,00.00 |
11 |
1 |
5,00.00 |
12 |
5 |
1,00.00 |
13 |
15 |
1,500.00 |
14 |
50 |
10,000.00 |