Dlookup in a query?

  • Thread starter Thread starter nath
  • Start date Start date
N

nath

Hi

I have three tables, one is Person_Details, the 2nd is
Vacacny_Details, the 3rd is a Media_lookup table.

I have people in the person_details table who are applying
for jobs, these are linked to the Vacancy_details table by
a job number. In the vacancy table there is a media code,
which begins with two letters denoting the media type,
then a number indicating the number of the advert. I have
a lookup table Media_lookup that gives the full name of
the media from its two letters.

I need to know how to use a lookup based on the left
([job_mdeia_code],2) against the media_lookup table, so
instead of :

Media Apps
EM/1224 39

i get

Media Apps
Evening Mail 39

Can this be done?

TIA

Nath
 
You should be able to use the Left function in your where clause. I don't
know if that would work in your join clause or not.

Hi

I have three tables, one is Person_Details, the 2nd is
Vacacny_Details, the 3rd is a Media_lookup table.

I have people in the person_details table who are applying
for jobs, these are linked to the Vacancy_details table by
a job number. In the vacancy table there is a media code,
which begins with two letters denoting the media type,
then a number indicating the number of the advert. I have
a lookup table Media_lookup that gives the full name of
the media from its two letters.

I need to know how to use a lookup based on the left
([job_mdeia_code],2) against the media_lookup table, so
instead of :

Media Apps
EM/1224 39

i get

Media Apps
Evening Mail 39

Can this be done?

TIA

Nath
 
Yes, if you open the query in SQL view, you can use a Left([FieldName], 5)
as one side of a join.

(5 is just an example.)

Note that you will not be able to view this query in design view -- so, if
you do make this change, do not switch to design view, and if you do, do not
save the query when you close it.
 
Back
Top