Limit to queries

G

Gurtz

Hi again,

I have noticed that queries are limited as to how big they
can get. This makes sense, and discourages unneccessarily
bulky queries.

What is the limit, exactly? Is it, say, 256 characters?

The reason I ask is this: for the user to print multiple
records, I simply allow him/her to choose the records from
a point-form list, then use that information to open a
report with mutiple pages, where each page displays a
record. I use the 'where' argument in the DoCmd.OpenReport
method .. I construct the argument from the primary keys
that the user has selected from the list. "PriKey=10 OR
PriKey=313 OR PriKey=69 OR .." etc.

Of course, this can get too long. Right now, I force the
user to do only a certain number, unless s/he wants to
pritn ALL the records (Select * ..).

There must be a better solution to allow the user to
select individual reports to print, but I can't find one.

Any ideas?
Thanks,
Gurtz
[email = no $]
 
J

JohnFol

Number of characters in a cell in the query design grid 1,024
Number of characters for a parameter in a parameter query 255
Number of ANDs in a WHERE or HAVING clause 99
Number of characters in an SQL statement approximately 64,000



Search for "Specification" in the help screens for the complete list
 
G

Gurtz

Thanks guys, that's great!
Gurtz
-----Original Message-----
Instead of doing:

WHERE PriKey = 10 OR
PriKey = 313 OR
PriKey = 69......
PriKey = n

Why not do:

WHERE PriKey IN (10,313,69.....,n).

This will certainly save you alot of space, although from what JohnFol says,
this probably won't be an issue.

I can't comment on performance implications, but I suspect they would be
negligible.

Thanks

Tom


Gurtz said:
Hi again,

I have noticed that queries are limited as to how big they
can get. This makes sense, and discourages unneccessarily
bulky queries.

What is the limit, exactly? Is it, say, 256 characters?

The reason I ask is this: for the user to print multiple
records, I simply allow him/her to choose the records from
a point-form list, then use that information to open a
report with mutiple pages, where each page displays a
record. I use the 'where' argument in the DoCmd.OpenReport
method .. I construct the argument from the primary keys
that the user has selected from the list. "PriKey=10 OR
PriKey=313 OR PriKey=69 OR .." etc.

Of course, this can get too long. Right now, I force the
user to do only a certain number, unless s/he wants to
pritn ALL the records (Select * ..).

There must be a better solution to allow the user to
select individual reports to print, but I can't find one.

Any ideas?
Thanks,
Gurtz
[email = no $]


.
 

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