simple query question

S

stuckness

Hi, im using access and want to filter some results so the first 2 hours get
flagged as one category and everything over 2 hours a different category.

Ive got a field returning the hours, so i want someting like; "if the 2 hr
limit hasnt been reached, return a value but if they have return another flag"

this must be easy but i cant figure it out.....
I'll appreciate any help....
 
A

Al Campagna

stuck,
Ive got a field returning the hours
You should have two fields, StartTime and End Time, and the down time would be the
difference between the two. Actually, it would be better tove the StartDateTime and End
DateTime if down time can exceed 24 hrs.
Create a calculated field in your query...
DownHours : =IIf(DateDiff("h",[StartTime],[EndTime])>=2,"Cat1","Cat2")

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 
S

stuckness

thanks but ive got no problem calculating the duration field- the 2 hour
limit is on all records so could be 4x .25 hrs or 1x 2hr.

then any other record regardless of the duration needs to be flagged with a
different category.....

hopefully this makes sense....any ideas?



Al Campagna said:
stuck,
Ive got a field returning the hours
You should have two fields, StartTime and End Time, and the down time would be the
difference between the two. Actually, it would be better tove the StartDateTime and End
DateTime if down time can exceed 24 hrs.
Create a calculated field in your query...
DownHours : =IIf(DateDiff("h",[StartTime],[EndTime])>=2,"Cat1","Cat2")

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."


stuckness said:
Hi, im using access and want to filter some results so the first 2 hours get
flagged as one category and everything over 2 hours a different category.

Ive got a field returning the hours, so i want someting like; "if the 2 hr
limit hasnt been reached, return a value but if they have return another flag"

this must be easy but i cant figure it out.....
I'll appreciate any help....
 
Top