Do I need to separate queries for this...

D

Dave

I have a Access 2003 parameterized query that is called from a web page.

The parameter passed to the query is an integer primary key.

If no id key is passed, I want to return all records rather than just one
specific record.

In SQL Server I can evaluate the call from within a stored proc and either
use or ignore a WHERE clause as appropriate.

But with an Access it looks like I need two separate queries: one
parameterized and the other unqualified.

Or is there a better way to handle this?
 
J

John W. Vinson

But with an Access it looks like I need two separate queries: one
parameterized and the other unqualified.

Or is there a better way to handle this?

Yes: a criterion of

WHERE [fieldname] = [parameter] OR [parameter] IS NULL

John W. Vinson [MVP]
 

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

Top