Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I use and aliased Field in a WHERE condition ?

Status
Not open for further replies.

Hiciano

IS-IT--Management
Jun 22, 2001
2
DO
Hi. I am trying to use an alias field in my WHERE clause but I get an error.

The idea is this:

SELECT name,lastname,socsecid AS id FROM Tablex WHERE id=100

Is this correct ?

Thanks !
 
Guys, Thanks a lot for your answers. The thing is that Jet answers the following with the Alias name and not the real name of the field.

dbData.Recordset.Fields(1).Name

How can I make Jet to give me back the real name of the field and not the alias ?
 
I'm not exactly sure what you are getting at. You can remove the alias from the query.

SELECT name,lastname,socsecid FROM Tablex WHERE socsecid=100 Terry

"I'm not dumb. I just have a command of throughly useless information." - Calvin, of Calvin and Hobbes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top