minutes aging

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. I need some assistance on writing criteria in a query to show records
that are 90 minutes or older.

Here's what I've got so far, but it doesn't work. :o\

=(Time$()-[Time logged])*1440>89

For one, the formula doesn't stay after saving the query; it just
disappears. And then I get a mismatch error when I run the query. The field
[Time Logged] is default valued at "Time$()", so I don't know if it's running
into some sort of loop in the formula or not...

Can anyone help me on this? Thanks.
 
Please post the SQL view of the query.

Try the DateDiff() function to see if that helps.

WHERE DateDiff("n", [Time Logged], Time()) >= 90

If you look at this in the design grid, this will probably give you a
calculated field with >= 90 as the criteria for that field. Also, [Time
Logged] will need to be defined in the table as a Date/Time data type.

You will run into problems if all you're storing is the time and the time
goes past midnight. If you store the Date and Time and compare that to
Now(), you'll eliminate the problem.
 
I just posted a long explaination but it seems to have gone up in smoke.
Here's the short version:

In the field put LoggedDiff: DateDiff("n", Time(), [Time logged])

In the criteria put >89

The [Time logged] field must be Date/Time to work. It might not be as Time$
presents the time as a string and not an actual time. That could be the
reason for the mismatch error.

Now why it isn't saving is another matter altogether.
 
I'm pretty much a novice developer; I've got the [Time logged] field as
date/time, but only the time shows up in the field on the table.

I did as you said; the query ran into no errors, but there was no data in
it. I've put a couple test records in. I think they should show up in the
query...?

BTW; your recommended changes took.

Jerry Whittle said:
I just posted a long explaination but it seems to have gone up in smoke.
Here's the short version:

In the field put LoggedDiff: DateDiff("n", Time(), [Time logged])

In the criteria put >89

The [Time logged] field must be Date/Time to work. It might not be as Time$
presents the time as a string and not an actual time. That could be the
reason for the mismatch error.

Now why it isn't saving is another matter altogether.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Hi. I need some assistance on writing criteria in a query to show records
that are 90 minutes or older.

Here's what I've got so far, but it doesn't work. :o\

=(Time$()-[Time logged])*1440>89

For one, the formula doesn't stay after saving the query; it just
disappears. And then I get a mismatch error when I run the query. The field
[Time Logged] is default valued at "Time$()", so I don't know if it's running
into some sort of loop in the formula or not...

Can anyone help me on this? Thanks.
 
Try switching the >89 to <89.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


I'm pretty much a novice developer; I've got the [Time logged] field as
date/time, but only the time shows up in the field on the table.

I did as you said; the query ran into no errors, but there was no data in
it. I've put a couple test records in. I think they should show up in the
query...?

BTW; your recommended changes took.

Jerry Whittle said:
I just posted a long explaination but it seems to have gone up in smoke.
Here's the short version:

In the field put LoggedDiff: DateDiff("n", Time(), [Time logged])

In the criteria put >89

The [Time logged] field must be Date/Time to work. It might not be as Time$
presents the time as a string and not an actual time. That could be the
reason for the mismatch error.

Now why it isn't saving is another matter altogether.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Hi. I need some assistance on writing criteria in a query to show records
that are 90 minutes or older.

Here's what I've got so far, but it doesn't work. :o\

=(Time$()-[Time logged])*1440>89

For one, the formula doesn't stay after saving the query; it just
disappears. And then I get a mismatch error when I run the query. The field
[Time Logged] is default valued at "Time$()", so I don't know if it's running
into some sort of loop in the formula or not...

Can anyone help me on this? Thanks.
 
Back
Top