L
Leslie
I have a database with "On Duty" dates and times combined in one field, for
example "04/20/2009 06:015:00 AM". I am trying to group the time values by
shift. The date isn't important. I couldn't figure out how to do this with
such a large date so I created a table with TimeValue and now I am trying to
compare the times using IIF statements:
1st Shift is between 06:30:00 AM and 02:30:00 PM
2nd shift is between 02:30:00 PM and 10:30:00 PM
3rd shift is between 10:30:00 PM and 06:30:00 AM
I have tried writing lots of ways to write this. Here's the latest:
Shift: IIf([T_ZZ_2009_Crew_Chart_Data]![On Duty Time]<"02:30:00 PM","1st
Shift",IIf([T_ZZ_2009_Crew_Chart_Data]![On Duty Time]<"10:30:00 PM","2nd
shift",IIf([T_ZZ_2009_Crew_Chart_Data]![On Duty Time]<"06:30:00 AM","3rd
Shift")))
What is the best way to do this? Do i need the quotes around teh times?
Should I use "Between" and if so, how?
Thanks,
example "04/20/2009 06:015:00 AM". I am trying to group the time values by
shift. The date isn't important. I couldn't figure out how to do this with
such a large date so I created a table with TimeValue and now I am trying to
compare the times using IIF statements:
1st Shift is between 06:30:00 AM and 02:30:00 PM
2nd shift is between 02:30:00 PM and 10:30:00 PM
3rd shift is between 10:30:00 PM and 06:30:00 AM
I have tried writing lots of ways to write this. Here's the latest:
Shift: IIf([T_ZZ_2009_Crew_Chart_Data]![On Duty Time]<"02:30:00 PM","1st
Shift",IIf([T_ZZ_2009_Crew_Chart_Data]![On Duty Time]<"10:30:00 PM","2nd
shift",IIf([T_ZZ_2009_Crew_Chart_Data]![On Duty Time]<"06:30:00 AM","3rd
Shift")))
What is the best way to do this? Do i need the quotes around teh times?
Should I use "Between" and if so, how?
Thanks,