SELECT
Iif([Date Performed] >= [Enter a Date], "On or After", "Before") As
BeforeAfter,
Count(*) As TestCount
FROM
MyTable
WHERE
[Test Type] = [Enter a Test Type]
GROUP BY
Iif([Date Performed] >= [Enter a Date], "On or After", "Before")
If you are unfamiliar with SQL, proceed as follows:
Start a new query in the query designer.
Click the "SQL" button on the toolbar, or select it from the View menu.
Paste the above code into the SQL window, being sure to replace the
"SELECT;" text that Access fills in automatically.
Replace "MyTable" with the actual name of your table.
Change back to the Design view (again from the toolbar or view menu), so you
can study the graphical representation of the query.
You may need to modify the last line above depending on how you want to
treat tests that were *on* the date you specify.
"Brian" <Brian.Kibler@gmail.comwrote in message
news:fe7123e6-e146-4bc0-a814-e9763202128f@y5g2000hsf.googlegroups.com...
Quote:
>I am trying to make a query and I am stuck. There probably is a
simple solution to this so hopefully one of you can help. Here is
what I want to do:
>
I have a table that has 2 fields (Test Type and Date Performed). The
table is populated with 6 or 7 different test types and the date each
was performed. Each test type will be performed a bunch of times so
there will be more than one entry for each type. What I want to do is
count the number of tests for a certain test type performed before a
specified date and count the ones performed after that date. Is there
an easy way to do this?
>
Thanks.