Re: Simple to Extreme Criteria Queries
- From: "Pete D." <pduffy211AT@xxxxxxxxxx>
- Date: Wed, 30 Jul 2008 20:37:11 -0400
it isn't unheard of to have a query based on other queries or chain table
builds from other queries. There is a response time impact so depends on
amount of data you are dealing with.
"CorporateQAinTX" <CorporateQAinTX@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:9751EB19-1F82-40E1-B8D0-1C8D7E2B8A83@xxxxxxxxxxxxxxxx
Is it possible to use more than one query at a time?
"Pete D." wrote:
Ouch, a simple query will not work for this as you are over the var
numbers.
Can you do it, yes but your going to have to build the SQL in VB/A to
make
it work. Me personnally I would reduce the need to by all departments or
(note I didn't say And) then break down departments. Can you do it all
with
one query (SQL VBA twist) yes. But presenting all those to the user will
probally confuse them, better to take them down a few levels first.
Better
to have 10 queries then one that no one can figure out how to get the
info
they need. Department, Date, etc.
"CorporateQAinTX" <CorporateQAinTX@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:CFEC6E02-BB85-4976-AA91-92A2F4C6549F@xxxxxxxxxxxxxxxx
SELECT Holdware.TicketNumber, Holdware.DateHeld,
Holdware.DefectDescription,
Holdware.Location, Holdware.ProductType, Holdware.ProductCapacityStyle,
Holdware.PreformCode, Holdware.MachineType, Holdware.MachineNumber,
Holdware.ShiftID, Holdware.QuantityHeld, Holdware.Disposition1,
Holdware.TotalDisposition1, Holdware.Disposition2,
Holdware.TotalDisposition2, Holdware.Disposition3,
Holdware.TotalDisposition3, Holdware.DateCompleted, Holdware.Closed
FROM Holdware
WHERE (((Holdware.DateHeld) Between [Forms]![Create A
Report]![txtStartDate]
And [Forms]![Create A Report]![txtEndDate]) AND
((Holdware.Location)=[Forms]![Create A Report]![Location]) AND
((Holdware.ProductType)=[Forms]![Create A Report]![ProductType]) AND
((Holdware.ProductCapacityStyle)=[Forms]![Create A
Report]![BottleType])
AND
((Holdware.PreformCode)=[Forms]![Create A Report]![PreformType]) AND
((Holdware.MachineType)=[Forms]![Create A Report]![Machine]) AND
((Holdware.MachineNumber)=[Forms]![Create A Report]![MachineNumber])
AND
((Holdware.ShiftID)=[Forms]![Create A Report]![Shift]) AND
((Holdware.Closed)=[Forms]![Create A Report]![TicketStatus]))
ORDER BY Holdware.QuantityHeld DESC;
I'm not very good at SQL. I'm just using the Query Design View, so let
me
know if this is useful. Thanks.
"Pete D." wrote:
Switch to SQL view and post the code. I think you may have some
missing
code as you know from you question, which I also think is causing a
problem.
Get some more eyes on the sql code we may be able to see it.
"CorporateQAinTX" <CorporateQAinTX@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:A507920F-3504-4D0C-AFA8-47D8E08DA36D@xxxxxxxxxxxxxxxx
So far everyone has been so helpful. Thanks.
Here goes another issue.
I've built a form for entering parameters into a query. The query is
setup
to accept the data entered into the different controls on the form.
In
all
there are 20 possible variables broken up into 7 sections. Each
section
can
give a specific parameter or there is an option to enter all
(haven't
quite
figured out how to set up that in code yet). Most of the choices are
based
in
Option Groups, so there is only one choice that can be chosen.
However,
if
you choose a specific option then a combo box is enabled so you can
be
even
more specific. Or you can leave it blank, which I also think is
causing
a
problem.
Confused yet?
So you can look for a certain product or generic product type,
looking
in
all departments or a specific department, on all shifts or a
specific
one,
and yada yada yada.
I can't figure out if it's possible to make a query that will accept
all
of
these variables or be able to distinguish if one is null and to
disregard
it.
Should I just create 15 or 20 different queries? My problem is, what
if
someone wants to look at a specific product produced within a time
frame
from
a certain shift and machine? If I can create a query that will do
that
as
well as a generic what items are in the table in this time frame it
would
be
great.
Any suggestions?
.
- Follow-Ups:
- Re: Simple to Extreme Criteria Queries
- From: John Spencer
- Re: Simple to Extreme Criteria Queries
- References:
- Re: Simple to Extreme Criteria Queries
- From: Pete D.
- Re: Simple to Extreme Criteria Queries
- From: CorporateQAinTX
- Re: Simple to Extreme Criteria Queries
- From: Pete D.
- Re: Simple to Extreme Criteria Queries
- From: CorporateQAinTX
- Re: Simple to Extreme Criteria Queries
- Prev by Date: Re: Search Date and Time
- Next by Date: Re: Headache on Outer Join with Crosstab
- Previous by thread: Re: Simple to Extreme Criteria Queries
- Next by thread: Re: Simple to Extreme Criteria Queries
- Index(es):
Relevant Pages
|