Do I need to separate queries for this...

  • Thread starter Thread starter Dave
  • Start date Start date
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?
 
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]
 
Back
Top