Count & Date Statement

dhess62

New member
Local time
Today, 14:00
Joined
Mar 24, 2009
Messages
6
Can someone tell me how to get this query to just show me the NUM_TAPE_MOUNTS from yesterday. The way it is now, it shows me many days wortj. I'm not quite sure how to alter the Count...... statement



SELECT DISTINCT TESTSUMMARY.LIBRARY_NAME, TESTSUMMARY.DRIVE_NAME, Count ((Now()-Start_TIme)) AS NUM_TAPE_MOUNTS from TESTSUMMARY GROUP BY TESTSUMMARY.LIBRARY_NAME, TESTSUMMARY.DRIVE_NAME;
 
You will need to add something to your query that has the date in it unless start_time is formatted date:time..

If thats the case you will need to put a where statement in there that checks to make sure that the date is set to yesterday
 
START_TIME in this is in the form of 5/7/2009 12:59:30 AM.

So how do it get it to just look at todays date?
 
Can someone tell me how to get this query to just show me the NUM_TAPE_MOUNTS from yesterday. The way it is now, it shows me many days wortj. I'm not quite sure how to alter the Count...... statement

START_TIME in this is in the form of 5/7/2009 12:59:30 AM.

So how do it get it to just look at todays date?

You are confusing me... yesterdays date or todays?

you can add

WHERE (((DateDiff("d",[Start_Time],Date()))=1)) To your criteria for yesterday
 

Users who are viewing this thread

Back
Top Bottom