BlackBox95
Technical User
Hello all,
I have an .mdb that keeps track of construction Equipment and vehicle inventory. I am trying to come up with a query that will sort the items by age (newest to oldest)and/or by serial number (newest to oldest).
My problem occurs when i recieve an inventory listing that does not have a year but does have a serial number. If there is no year listed, i want to sort by serial number so that the listing still falls in the correct place within the correct year. I cant just sort by decreasing serial number because this is a text field and would produce erroneous results because of the alphabetic characters in the Serial nUmber field.
this is part of my ORDER BY statement:
IIf(Equipment.Year Is Not Null,Equipment.Year,Equipment.[Serial Number]) DESC, Equipment.[Serial Number] DESC;
but this sorts the items w/ no year at the top
can anyone point me in the right direction?
JC
I have an .mdb that keeps track of construction Equipment and vehicle inventory. I am trying to come up with a query that will sort the items by age (newest to oldest)and/or by serial number (newest to oldest).
My problem occurs when i recieve an inventory listing that does not have a year but does have a serial number. If there is no year listed, i want to sort by serial number so that the listing still falls in the correct place within the correct year. I cant just sort by decreasing serial number because this is a text field and would produce erroneous results because of the alphabetic characters in the Serial nUmber field.
this is part of my ORDER BY statement:
IIf(Equipment.Year Is Not Null,Equipment.Year,Equipment.[Serial Number]) DESC, Equipment.[Serial Number] DESC;
but this sorts the items w/ no year at the top
can anyone point me in the right direction?
JC