2 Date counts

browny

Registered User.
Local time
Today, 19:07
Joined
Mar 7, 2006
Messages
32
Hi all
I have a problem trying to create a query to count 2 dates in one query. I have recorded dates for the return of forms from specific types of vehicles, the first date is the date the form is for, the second is the date I received it.
I have a query that returns the count of the forms received per vehicle type. I have tried adding a second field in this query to count the days where the date for is within "x" days of the date received. However when I try to run the query I get an error saying that the query has a field that is not part of an aggregate function.
Is it possible to create this as 1 query or do I need multiple queries to get a result.

Thanks
Craig
 
Hi all
I have a problem trying to create a query to count 2 dates in one query. I have recorded dates for the return of forms from specific types of vehicles, the first date is the date the form is for, the second is the date I received it.
I have a query that returns the count of the forms received per vehicle type. I have tried adding a second field in this query to count the days where the date for is within "x" days of the date received. However when I try to run the query I get an error saying that the query has a field that is not part of an aggregate function.
Is it possible to create this as 1 query or do I need multiple queries to get a result.

Thanks
Craig
Have you tried a UNION? Sometimes you can use it to put several queries into one query statement, as long as you find a way to insure that each query outputs the same number of columns and datatypes.
 
Solved sort of

Hi all
Built out a work around where I have calculated the date differences inthe first query and have then built other queries from this data.
Simple solution in the end, just was not looking at the problem correctly initially,thanks for viewing and the reply.
Craig
 

Users who are viewing this thread

Back
Top Bottom