M
mark.godecke
Hello,
I'm trying to create a query to give the number of unique clients
served between a range of dates. Basically, I want count each unique
ClientID in the table "Records", when the Date column for records in
that table falls between two dates in a second table
"UserEnteredDate".
I looked through past messages in this group, but the only solutions
require using SQL, which I know zero about. I copied the example SQL
given, but I couldn't figure out how to include criteria from a second
table. This is what I have so far, but when I attempt to run the query
I get an error "Syntax Error in the From Clause." I tried Access's
built in help, but found it less than informative in telling me the
proper format to use.
SELECT Count(Records.ClientID) AS CountOfClientID
FROM (SELECT DISTINCT [ClientID] FROM Records)
FROM (UserEnteredDate)
WHERE (((Records.Date) Between
[UserEnteredDate]![UserEnteredSearchDate] And
[UserEnteredDate]![UserEnteredSearchDatePrev]))
GROUP BY UserEnteredDate.UserEnteredSearchDate,
UserEnteredDate.UserEnteredSearchDatePrev;
I hope it just needs a simple correction in punctuation, and if
somebody who knows what they are doing could tell me what that is, I'd
be very greatful.
I'm trying to create a query to give the number of unique clients
served between a range of dates. Basically, I want count each unique
ClientID in the table "Records", when the Date column for records in
that table falls between two dates in a second table
"UserEnteredDate".
I looked through past messages in this group, but the only solutions
require using SQL, which I know zero about. I copied the example SQL
given, but I couldn't figure out how to include criteria from a second
table. This is what I have so far, but when I attempt to run the query
I get an error "Syntax Error in the From Clause." I tried Access's
built in help, but found it less than informative in telling me the
proper format to use.
SELECT Count(Records.ClientID) AS CountOfClientID
FROM (SELECT DISTINCT [ClientID] FROM Records)
FROM (UserEnteredDate)
WHERE (((Records.Date) Between
[UserEnteredDate]![UserEnteredSearchDate] And
[UserEnteredDate]![UserEnteredSearchDatePrev]))
GROUP BY UserEnteredDate.UserEnteredSearchDate,
UserEnteredDate.UserEnteredSearchDatePrev;
I hope it just needs a simple correction in punctuation, and if
somebody who knows what they are doing could tell me what that is, I'd
be very greatful.