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!

"AS" keyword, to rename a table

Status
Not open for further replies.

halx

Programmer
Jun 5, 2002
35
FR
Hello !
I have written this query in the SQL view part of Access 2000's query editor:

SELECT IDTester, toBeTested
FROM tblTests INNER JOIN tblScenariosAndDescriptions ON (tblTests.IDFunction = tblScenariosAndDescriptions.IDFunction)

and it perfectly works (IDTester is a field from tblTests and toBeTested is one from tblScenariosAndDescriptions).

Now I want to name the table that is created when I do the junction (because I will include this query in another one):

SELECT IDTester, toBeTested
FROM tblTests INNER JOIN tblScenariosAndDescriptions ON (tblTests.IDFunction = tblScenariosAndDescriptions.IDFunction) AS myTable


But this doesn't work. I get "Syntax error in FROM clause".

How should the "AS" keyword be used ?

Thanks

Alex
 
If you do a make-table query (I don't think that's what you're describing) you'll be prompted for the table name.

In what you have above you can save the query object itself with the name of your choice and refer to it in subsequent queries.

It sounds like you're accustomed to writing SQL in an editor. In access it's really easy to just add your previously saved subquery as if it were a table and join on the appropriate fields.
 
Yes, I agree it is easy to save a query and use it in another query, just as if it were a table. But for my project, by doing this, I come out with a lot of stored subqueries (that I use only once). That is why I prefer writing "big" queries.

What do you think ? Does anybody have tips about managing queries (how to classify them...)?


thanks

Alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top