I
ironwood9 via AccessMonster.com
I have 2 tables: tblEqLoc has the following fields:
Start Date | StartTime | EndDate | EndTime | CustNum | SerialNum |
EqStatus
tblEndDate has : EndDate, CustNum, and SerialNum that can be joined with
tblEqLoc
In the CustNum field is either a customer number or a warehouseID number.
CustNums always start with 3004 – all other numbers start with zeros.
When all the data is sorted ascending chronologically, the start date and
start time for any given record is always equal to the end date / end time
for the previous record.
I need to create a query that will show the first record that ISN’T populated
with a customer number AFTER the last record chronologically (by date, by
time)
If a true customer number (not a warehouse #) is in the CustNum field, it
will have either a D or an H for the EqStatus – the record I want returned in
my query will always have an “R†for the EqStatus, and the previous record
will be a “D.†Always.
I could get the DATE I’m looking for by joining on the EqSerialNum, but I am
concerned not only with the last date, but the last date and time.
So I want my query to return, by serial number, the record AFTER the latest
record (by date AND time) that was populated by a “true†customer number in
the CustNum field, which always starts with 3004, and is going to be a “D†in
the EqStatus in that key record that is the last record with a customer
number, and then I want the next record (Chronologically, by date and time)
after that to be the record returned in my query.
Start Date | StartTime | EndDate | EndTime | CustNum | SerialNum |
EqStatus
tblEndDate has : EndDate, CustNum, and SerialNum that can be joined with
tblEqLoc
In the CustNum field is either a customer number or a warehouseID number.
CustNums always start with 3004 – all other numbers start with zeros.
When all the data is sorted ascending chronologically, the start date and
start time for any given record is always equal to the end date / end time
for the previous record.
I need to create a query that will show the first record that ISN’T populated
with a customer number AFTER the last record chronologically (by date, by
time)
If a true customer number (not a warehouse #) is in the CustNum field, it
will have either a D or an H for the EqStatus – the record I want returned in
my query will always have an “R†for the EqStatus, and the previous record
will be a “D.†Always.
I could get the DATE I’m looking for by joining on the EqSerialNum, but I am
concerned not only with the last date, but the last date and time.
So I want my query to return, by serial number, the record AFTER the latest
record (by date AND time) that was populated by a “true†customer number in
the CustNum field, which always starts with 3004, and is going to be a “D†in
the EqStatus in that key record that is the last record with a customer
number, and then I want the next record (Chronologically, by date and time)
after that to be the record returned in my query.