simple query question

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

Guest

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....
 
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."
 
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....
 

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