Time minus 30mins

  • Thread starter Thread starter Middy
  • Start date Start date
M

Middy

Hi,

I need to make a query that looks a the time entered in one column.
then filter anything that has not past that time but include rows that
have just pasted now() within 30mins.

Presently it looks like this;
Format(=Now(),"Short Time")

If its 11:30 and the column has rows 10:00, 11:00, 12:00, 13:00 etc the
query will return everything past 11:30 . The 10:00 and 11:00 will not
be shown.

I need this query to show 11:00 also. i.e evey thing =now()-30mins.

Hoped something like >Format(Now()"h",-0.5) would have worked, but
doesnt :(

Thanks for your help.

Dave
 
Hi,

I need to make a query that looks a the time entered in one column.
then filter anything that has not past that time but include rows that
have just pasted now() within 30mins.

Presently it looks like this;

If its 11:30 and the column has rows 10:00, 11:00, 12:00, 13:00 etc the
query will return everything past 11:30 . The 10:00 and 11:00 will not
be shown.

I need this query to show 11:00 also. i.e evey thing =now()-30mins.

Hoped something like >Format(Now()"h",-0.5) would have worked, but
doesnt :(

Don't use the Format() function! It converts its argument into a Text
String - which is very likely to be WRONG.

To get all values for this time between now and thirty minutes ago
(your statement of the criterion is a bit ambiguous) use a criterion
on the time field of

Between DateAdd("n", -30, Now()) AND Now()

John W. Vinson[MVP]
 
The dateadd function allows this type of time manipulation. Look it up in
the help for all the details of its use.

Daniel
 
Middy said:
Hi,

I need to make a query that looks a the time entered in one column.
then filter anything that has not past that time but include rows that
have just pasted now() within 30mins.

Presently it looks like this;

If its 11:30 and the column has rows 10:00, 11:00, 12:00, 13:00 etc the
query will return everything past 11:30 . The 10:00 and 11:00 will not
be shown.

I need this query to show 11:00 also. i.e evey thing =now()-30mins.

Hoped something like >Format(Now()"h",-0.5) would have worked, but
doesnt :(

Thanks for your help.

Dave
 
If its 11:30 and the column has rows 10:00, 11:00, 12:00, 13:00 etc the
query will return everything past 11:30 . The 10:00 and 11:00 will not
be shown.

I need this query to show 11:00 also. i.e evey thing =now()-30mins.

Hoped something like >Format(Now()"h",-0.5) would have worked, but
doesnt :(

The Format() function formats data into text. It doesn't add or
subtract dates.

The DateAdd() function does - but only integer values. Use

DateAdd("n", -30, Now())

to subtract 30 miNutes ("m" is Months) from the current time.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top