Wild card problem in query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using a 4 separate parameter queries to make 4 separate reports. The
queries are identical in what parameters they are promopted for, in fact, the
only difference is that they need to only include 1 of 4 possible groups of
data.

The Field used to categorize what data goes into what report is called
Category. There are 4 possible category types: DTWL*, DTWS*, SCWL*, SCWS*
(for example, the entries in the DTWL category for example inlcude DTWL1,
DTWL2, DTWL3, etc. ) Anyway, I have it set as a where Like "DTWL*" in the
query for the DTWL report. Currently, though, all four types show up in the
DTWL report. I would appreciate any help on what I'm doing wrong. Thanks!
 
The wildcard is going to match "DTWL" followed by 0 or more of whatever
character(s) you provide. So saying LIKE "DTWL*" cannot differentiated
between DTWL1, DTWL2, etc. All 4 fit the pattern that is being matched to.

Either make your criteria read LIKE "DTWL" & [Enter a number from 1 to 4],
which will prompt the user for the report that is wanted or create a form
that builds this string using a value in a list box initialized with a value
list. Or, since it is also necessary to differentiate among DTW[LS] and
SCW[LS], you could set your criteria to read = [Enter the report type]. This
of course requires your users to know the full name of the report type they
want.

Good Luck!
 
I'm using a 4 separate parameter queries to make 4 separate reports. The
queries are identical in what parameters they are promopted for, in fact, the
only difference is that they need to only include 1 of 4 possible groups of
data.

The Field used to categorize what data goes into what report is called
Category. There are 4 possible category types: DTWL*, DTWS*, SCWL*, SCWS*
(for example, the entries in the DTWL category for example inlcude DTWL1,
DTWL2, DTWL3, etc. ) Anyway, I have it set as a where Like "DTWL*" in the
query for the DTWL report. Currently, though, all four types show up in the
DTWL report. I would appreciate any help on what I'm doing wrong. Thanks!

Use a slightly different syntax:

LIKE [Enter category type, e.g. DTWL:] & "*"

This will prompt the user to enter a category and should find all
records for the category that they enter.

This way you need only one query and only one report.

John W. Vinson[MVP]
 
Back
Top