Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unmatched Data Query

Status
Not open for further replies.

Basshopper

Technical User
Dec 27, 2003
114
US
I have a query that am trying to show just the data in the mfg # and the alt mfg # that don't match as null and within the data itself in other words mfg # that don't match. Not sure what criteria to do this. Thanks for your help in advance. Here is my SQL Code

SELECT DISTINCTROW [q_Quote BOM Form].[Customer ID], [q_Quote BOM Form].[Assembly #], [q_Quote BOM Form].
# said:
, [q_Quote BOM Form].[Line #], [q_Quote BOM Form].MFG, [q_Quote BOM Form].[MFG #], [q_Alt and Vendor Parts Subform].[Alt MFG #]
FROM [q_Quote BOM Form] INNER JOIN [q_Alt and Vendor Parts Subform] ON ([q_Quote BOM Form].[Line #] = [q_Alt and Vendor Parts Subform].[Line #]) AND ([q_Quote BOM Form].
# said:
= [q_Alt and Vendor Parts Subform].
# said:
) AND ([q_Quote BOM Form].[Assembly #] = [q_Alt and Vendor Parts Subform].[Assembly #]) AND ([q_Quote BOM Form].[Customer ID] = [q_Alt and Vendor Parts Subform].[Customer ID])
GROUP BY [q_Quote BOM Form].[Customer ID], [q_Quote BOM Form].[Assembly #], [q_Quote BOM Form].
# said:
, [q_Quote BOM Form].[Line #], [q_Quote BOM Form].MFG, [q_Quote BOM Form].[MFG #], [q_Alt and Vendor Parts Subform].[Alt MFG #]
HAVING ((([q_Quote BOM Form].[Customer ID]) Like [forms]![Parameter]![Customer ID] & "*") AND (([q_Quote BOM Form].[Assembly #]) Like [FORMS]![Parameter]![Assembly #] & "*") AND (([q_Quote BOM Form].
# said:
) Like [FORMS]![Parameter]!
# said:
& "*"))
ORDER BY [q_Quote BOM Form].[Customer ID], [q_Quote BOM Form].[Assembly #], [q_Quote BOM Form].
# said:
, [q_Quote BOM Form].[Line #];
 
Why using a GROUP BY clause if you don't need aggregate function ?
Here a query to list joined quotes having different mfg#:
SELECT [q_Quote BOM Form].[Customer ID], [q_Quote BOM Form].[Assembly #], [q_Quote BOM Form].
# said:
, [q_Quote BOM Form].[Line #], [q_Quote BOM Form].MFG, [q_Quote BOM Form].[MFG #], [q_Alt and Vendor Parts Subform].[Alt MFG #]
FROM [q_Quote BOM Form] INNER JOIN [q_Alt and Vendor Parts Subform] ON ([q_Quote BOM Form].[Line #] = [q_Alt and Vendor Parts Subform].[Line #]) AND ([q_Quote BOM Form].
# said:
= [q_Alt and Vendor Parts Subform].
# said:
) AND ([q_Quote BOM Form].[Assembly #] = [q_Alt and Vendor Parts Subform].[Assembly #]) AND ([q_Quote BOM Form].[Customer ID] = [q_Alt and Vendor Parts Subform].[Customer ID])
WHERE ((([q_Quote BOM Form].[Customer ID]) Like [forms]![Parameter]![Customer ID] & "*") AND (([q_Quote BOM Form].[Assembly #]) Like [FORMS]![Parameter]![Assembly #] & "*") AND (([q_Quote BOM Form].
# said:
) Like [FORMS]![Parameter]!
# said:
& "*"))
AND [q_Quote BOM Form].[MFG #]<>[q_Alt and Vendor Parts Subform].[Alt MFG #]
ORDER BY [q_Quote BOM Form].[Customer ID], [q_Quote BOM Form].[Assembly #], [q_Quote BOM Form].
# said:
, [q_Quote BOM Form].[Line #];

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I did finally figured it out and came to the same conclusion. Thanks for verifing the solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top