Call Sub-query with Parameter

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

Is it possible in Microsoft Access 2007 to call a sub-query and
sending its parameter?

Sub-query (UsersByType):
SELECT *
FROM USERS
WHERE USERS.TYPE=[@UserType];

And now on the query I want to call this table as follows:
SELECT *
FROM UsersByType AS ubt
WHERE ubt.UserType = "Administrator";

Obviously this does not work.

I tried other options like:
SELECT *
FROM UsersByType AS ubt("Administrator");

This does not work either.

Does anyone knows if this is possible in Microsoft Access 2007?

Thank You,
Miguel
 
You're using an SQL Server parameter type (prefixed with @).  Are you
using SQL Server as a back end (data tables)?  

I am using Microsoft Access 2007.
When @ is used the parameter value is asked.
Am I missing something?

I need to make this in Access not in SQL Server.
 
Back
Top