Re: query with crazy parameters
- From: turkey <turkey@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 23 Jun 2005 08:04:04 -0700
SELECT [Motors in Operation].WONUMBER, Outline.[XP#], Models.Model, [Stator
Assy].[Sta Winding Spec], Winding.W_NO, [Low hp winding test
data].Winding.W_NO, [Low voltage winding data].Winding.W_NO, [High voltage
winding data].W_NO, [High hp winding test data].Winding.W_NO
FROM ((((((Models RIGHT JOIN ([Motors in Operation] LEFT JOIN Outline ON
[Motors in Operation].OUTLINE = Outline.[Outline Number]) ON Models.Model =
Outline.Model) LEFT JOIN [Stator Assy] ON Models.[Stator Assembly] = [Stator
Assy].[Stator Wound Assy]) LEFT JOIN [Low hp winding test data] ON
Models.[Stator Assembly] = [Low hp winding test data].Winding.W_NO) LEFT JOIN
[Low voltage winding data] ON Models.[Stator Assembly] = [Low voltage winding
data].Winding.W_NO) LEFT JOIN [High hp winding test data] ON Models.[Stator
Assembly] = [High hp winding test data].Winding.W_NO) LEFT JOIN [High voltage
winding data] ON Models.[Stator Assembly] = [High voltage winding data].W_NO)
LEFT JOIN Winding ON [High voltage winding data].W_NO = Winding.W_NO
WHERE ((([Motors in Operation].WONUMBER)=[serial no]) AND (([Low hp winding
test data].Winding.W_NO) Like [motors in operation to stator assymbly]![sta
winding spec] & "*") AND (([Low voltage winding data].Winding.W_NO) Like
[motors in operation to stator assymbly]![sta winding spec] & "*") AND
(([High voltage winding data].W_NO) Like [motors in operation to stator
assymbly]![sta winding spec] & "*") AND (([High hp winding test
data].Winding.W_NO) Like [motors in operation to stator assymbly]![sta
winding spec] & "*"));
i want w_no for all 5 winding tables(winding, low voltage, high voltage, low
hp, and high hp)to be displayed. sta winding spec will match winding exactly
but in the other 4 the number will be followed by a h,l,a, or b --depending
if its high or low V or high or low hp. the problem i'm having is if there
are no mathching records in one of the tables, then no records are displayed.
i might be going about this all wrong.
also, the high/low voltages/hp are queries obtained from the original
winding table.this all came about because i want to store all windings in the
same table but i'm having a hard time retrieving different sets of test data
(ex. xxx-a and xxx-b) that would be shown on a single report.
--
"John Vinson" wrote:
> On Thu, 23 Jun 2005 05:15:01 -0700, turkey
> <turkey@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> >hi guys. . .
> >i have a query that asks for a parameter. one of the fields has criteria
> >like[table]![field]&"*". it is entered in the "or". does anyone have ideas
> >why this doesn't work? the field that asks for a parameter also has [serial
> >no] in the "or" as well.
>
> The syntax [table]! is invalid; you cannot refer to a table in that
> way.
>
> What's [table] mean in this context? Is it the name of a separate
> table, not part of the query? Could you post the SQL view of the query
> and indicate just what you expect it to accomplish?
>
> John W. Vinson[MVP]
>
.
- References:
- query with crazy parameters
- From: turkey
- Re: query with crazy parameters
- From: John Vinson
- query with crazy parameters
- Prev by Date: Check if Access is present
- Next by Date: Database Search
- Previous by thread: Re: query with crazy parameters
- Next by thread: newbee need's advice
- Index(es):
Relevant Pages
|