Not Pulling all the records for last 24 hours

You have not applied the filtering condition in your query correctly.

The Where Clause in a query filters records.

The Having Clause in a Totals Query filters returned results.


So to filter records, you have to put the record selection criteria in the Where Clause of the query, not in the Having Clause.
.
 
umm ok...lost what does that mean and how do i do it?

Sorry don't understand.

Rue
 
You have to move the criteria for the [Planned-Start] field to a Where Clause in the query as it is for record selection.

SELECT ........

FROM ..........

WHERE [48_Hour_Pull].[Planned-Start] Between DateAdd("d",-3,Date()) And DateAdd("d",0,Date())

GROUP BY .......

HAVING [48_Hour_Pull].[Severity-of-Change]="Emer Br/Fix"


Note:
1) DateAdd("d",0,Date()) is the same as Date() and will include records with "Today's Date at 0:0:0" as well.

So if the query is run today (Jan 29), your criteria [Planned-Start] Between DateAdd("d",-3,Date()) And DateAdd("d",0,Date()) will pull records from 1/26/2008 0:0:0 to 1/29/2008 0:0:0, which covers 72 hours and 1 second.

2) Depending on what Expr1 is, you may need to remove the [48_Hour_Pull].Expr1 from the Select Clause and the Group By Clause.
.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom