G
George Applegate
I have a two tables that look like:
Emp table Punch table
employee------------employee
lastname date
firstname time
department inorout
The link between the tables is employee
Each employee might have multiple ins and outs for a given date.
I'd like to somehow create a query that would display something like:
department employee date time in/out time in/out time in/out
(left to right have multiple times shown along with whether an in or
out.
Is this a "crosstab" query and if so, how do I code it so it
sequentially shows the time and in/out for say up to 6 or 8 punches?
If there are more than 8, ignore and go to next employee date or
employee...if less than 8 show them and go on to next employee
Query would look like:
Dpt Emp Date Time I/O Time I/O Time I/O
99 2000 01/01/08 8:30 In 11:30 Out 12:30 In...
99 2000 01/02/08 8:15 In 11:00 Out 11:45 In...
99 4000 01/01/08 8:00 In 12:00 Out 14:00 In...
display up to 6 or 8 times with corresponding in/out flag...
Or, if it's easier to somehow do it, it could go like this (and would
even be better)
Dpt Emp Date Time In Time out Time In Time out
99 2000 01/01/08 8:30 11:30 12:30 4:30
99 2000 01/02/08 8:15 11:00 11:45 16:00
99 4000 01/01/08 8:00 12:00 14:00 17:30
say up to 3 or 4 ins/out (6 or 8 total punches) displayed.
Is this possible?
thanks,
ga
George Applegate
(e-mail address removed)
Emp table Punch table
employee------------employee
lastname date
firstname time
department inorout
The link between the tables is employee
Each employee might have multiple ins and outs for a given date.
I'd like to somehow create a query that would display something like:
department employee date time in/out time in/out time in/out
(left to right have multiple times shown along with whether an in or
out.
Is this a "crosstab" query and if so, how do I code it so it
sequentially shows the time and in/out for say up to 6 or 8 punches?
If there are more than 8, ignore and go to next employee date or
employee...if less than 8 show them and go on to next employee
Query would look like:
Dpt Emp Date Time I/O Time I/O Time I/O
99 2000 01/01/08 8:30 In 11:30 Out 12:30 In...
99 2000 01/02/08 8:15 In 11:00 Out 11:45 In...
99 4000 01/01/08 8:00 In 12:00 Out 14:00 In...
display up to 6 or 8 times with corresponding in/out flag...
Or, if it's easier to somehow do it, it could go like this (and would
even be better)
Dpt Emp Date Time In Time out Time In Time out
99 2000 01/01/08 8:30 11:30 12:30 4:30
99 2000 01/02/08 8:15 11:00 11:45 16:00
99 4000 01/01/08 8:00 12:00 14:00 17:30
say up to 3 or 4 ins/out (6 or 8 total punches) displayed.
Is this possible?
thanks,
ga
George Applegate
(e-mail address removed)