Hello, I am working on a program in access and am stumped how I do this particular calculation.
I have two tables i'm working with:
1) Sheet1 - has all the information about my files (airwaybills like on UPS, it has all the information in here)
2) Airlines - this information has all the rates for each airline.
For the Table "Sheet1" I have a field named "AWB NUMBER" and it's in the format of XXX-XXXX-XXXX with the first three X's designating an "AIRLINE CODE".
The Table "airlines" has a field "AIRLINE CODE" and in this query I am creating I am trying to find the best way to make a query where the first three digits of the AWB are matched to the AIRLINE CODE, then the "CHARGE" in the "airline" table would be applied for that particular AWB. I have it all working but the only part I can't get to work is if I do not have the particular airline code in the system, the query will just ignore that entry in "sheet1".. Below is an example:
SHEET1:
REF# AWB NUMBER
1 020-5555-5555
2 172-5555-5555
3 999-5555-5555
AIRLINE:
AIRLINE CODE CHARGE
020 25
172 20
QUERY1:
REF# AWB NUMBER CHARGE
1 020-5555-5555 25
2 172-5555-5555 20
In the query I have added both Sheet1 and Airlines for tables. Under the SQL i'm selecting all the above fields THEN i'm using WHERE ([AIRLINE CODE]=Mid$([AWB NUMBER],1,3)).
I really want my query to add the 3rd file which doesn't have an airline code designated and I want it to put in a default value of say 25.. Can anybody help me?