Call Sub-query with Parameter

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
 
S

shapper

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top