Need some help with a "VLOOKUP" type of command

hockeyadc

Registered User.
Local time
Today, 11:12
Joined
Sep 6, 2011
Messages
20
I'm basically trying to perform a VLOOKUP in SQL but I can't seem to get it to work... heres the code I'm trying

SELECT Cities
FROM tblMetroAudCLcity
WHERE Citytype='Info2.area';

Returns an empty table for me :-(
 
Some more info would be helpful here. Do you actually have CityTypes that are equal to the value "Info2.area"? Or is that supposed to be a reference to a form control? Something else?
 
Some more info would be helpful here. Do you actually have CityTypes that are equal to the value "Info2.area"? Or is that supposed to be a reference to a form control? Something else?


Yes CityTypes are equal to values in area of the table Info2. Ideally I would like to take the values once it finds them and put them into another column in Info2 as well.
 
Please confirm.

When you view the table, you can see "Info2.area" in the column called "Citytype".
 
Please confirm.

When you view the table, you can see "Info2.area" in the column called "Citytype".


Ah, no I think this is where my problem is. I am looking for info that matches in the "Citytype" column to that of the "area" column in the table "Info2". Not neccasarily the words "Info2.area"
 
So you have a table called Info2 with a field named Area?

And this field is related to, or determines the range of values for, the field CityType in tblMetroAudCLcity?

I'm still not clear on what it is you're trying to accomplish, but if the above is true then one option may be to add the table Info2 to the query and create a join on the CityType/Area fields. What you're attempting now by just trying to put the TableName.FieldName in the criteria isn't going to work. Query criteria doesn't work that way.
 
I actually figure it out now. Thanks I realized my issue lol
 

Users who are viewing this thread

Back
Top Bottom