time calculations

S

Sharon

I am working on a Travel Expense Report database. I have two tables:

tblTrip
tblperdiem

The tblTrip has fields for StartDate, EndDate, StartDateStartFlightTime;
StartDateEndFlightTime; EndDateStartFlightTime and EndDateEndFlightTime.

The tblperdiem has fields for the cost of Breakfast, Lunch, Dinner.

I want the per diem amount to automatically fill in on the tblperdiem based
on the following calculation from the tblTrip:

If the StartDateStartFlightTime is before 10:00 a.m. – Breakfast is allowed
If the StartDateStartFlightTime is after 10:00 a.m. – Breakfast is not allowed

If the StartDateStartFlightTime is before 12:00 p.m. – Lunch is allowed
If the StartDateStartFlightTime is after 12:00 p.m. – Lunch is not allowed

If the StartDateStartFlightTime is before 6:00 p.m. – Dinner is allowed
If the StartDateStartFlightTime is after 6:00 p.m. – Dinner is not allowed

If the EndDateStartFlightTime is before 10:00 a.m. – Breakfast is allowed
If the EndDateStartFlightTime is after 10:00 a.m. – Breakfast is not allowed

If the EndDateStartFlightTime is before 12:00 p.m. – Lunch is allowed
If the EndDateStartFlightTime is after 12:00 p.m. – Lunch is not allowed

If the EndDateStartFlightTime is before 6:00 p.m. – Dinner is allowed
If the EndDateStartFlightTime is after 6:00 p.m. – Dinner is not allowed

Also, U.S. Travel and Foreign Travel have different per diem amounts. For
instance, breakfast in the U.S. is $10 and foreign is $15 and lunch U.S. is
$15 and foreign is $20 and dinner U.S. is $25 and foreign $35.

Help!

Thanks in advance.
 

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

Top