G
Guest
Hi. I'd appreciate any help with this problem. I've read threads on this
before, but couldn't get it right. I want to calculate the difference
between dates in a single field to help calculate trap*nights.
Here's the table structure in the table called tblADateID:
ADateID (pk) Status ADate TrapsSet
1 Opened 3/13/06 2
2 Closed 3/15/06 2
3 Opened 4/1/06 3
4 Checked 4/15/06 2
5 Checked 4/16/06 4
6 Closed 4/17/06 4
I'm trying to get a query that will write this:
TrapsSet Checked PriorCheck Nights TrapNights
2 3/15/06 3/13/06 2 4
3 4/15/06 4/1/06 14 42
2 4/16/06 4/15/06 1 2
4 4/17/06 4/16/06 1 4
"Nights" is the number of nights between an open and a check, a check and a
check, a check and a closed, or an open and a closed- essentially everything
except nights between closing and opening. TrapNights is the number of traps
set previously times the number of nights in that interval.
Eventually, I'd like to supply date parameters to calculate TrapNights for a
given interval.
Thanks for any help.
ak
before, but couldn't get it right. I want to calculate the difference
between dates in a single field to help calculate trap*nights.
Here's the table structure in the table called tblADateID:
ADateID (pk) Status ADate TrapsSet
1 Opened 3/13/06 2
2 Closed 3/15/06 2
3 Opened 4/1/06 3
4 Checked 4/15/06 2
5 Checked 4/16/06 4
6 Closed 4/17/06 4
I'm trying to get a query that will write this:
TrapsSet Checked PriorCheck Nights TrapNights
2 3/15/06 3/13/06 2 4
3 4/15/06 4/1/06 14 42
2 4/16/06 4/15/06 1 2
4 4/17/06 4/16/06 1 4
"Nights" is the number of nights between an open and a check, a check and a
check, a check and a closed, or an open and a closed- essentially everything
except nights between closing and opening. TrapNights is the number of traps
set previously times the number of nights in that interval.
Eventually, I'd like to supply date parameters to calculate TrapNights for a
given interval.
Thanks for any help.
ak