In my attached DB, i have made a query in which i am trying to fetch 'AVC Class Code' from 'Fare Table' through D LookUP but it is not working therefore please help me on the same.
The criteria for DLookup is
=DLookup(fieldname, table/query name, filter criteria)
However, don't use a DLookup.
Instead, add the Fare_Table to the query and join by field AVC_Class
Code:
SELECT Table1.[AVC Class]
FROM Table1 INNER JOIN Fare_Table ON Table1.[AVC Class] = Fare_Table.[AVC Class];
I strongly recommend you remove ALL spaces from field and table names as they will cause issues
I also avoid underscores but that's personal preference
The criteria for DLookup is
=DLookup(fieldname, table/query name, filter criteria)
However, don't use a DLookup.
Instead, add the Fare_Table to the query and join by field AVC_Class
Code:
SELECT Table1.[AVC Class]
FROM Table1 INNER JOIN Fare_Table ON Table1.[AVC Class] = Fare_Table.[AVC Class];
I strongly recommend you remove ALL spaces from field and table names as they will cause issues
I also avoid underscores but that's personal preference
i am trying to fetch the result in query 1 through joining but it is not being done therefore i want to get the result in query 1 which i have shown in column 3 and 4 of Table 1.
Please provide the solution and i shall be highly thankful to you for this favour.
Sorry but I'm not really sure what you are asking
I think you only need one link between the 2 tables:
Code:
SELECT Table1.ID, Fare_Table.[WIM CLass Code], Fare_Table.[AVC Class Code]
FROM Table1 INNER JOIN Fare_Table ON Table1.[AVC Class] = Fare_Table.[AVC Class]
ORDER BY Table1.ID;
I've used an INNER join - see Query1 attached
Query2 was what I posted previously