Select Query - Help

E

Elizabeth

I am working on a select query where my results are
intermittently. Most of the time the Part number and part
description fields are populated, but sometimes it's not.
I've tried using all of the joins and the results are the
same. When I look looked in the table the information is
present but it's not showing up in the query. I don't
know why the information is not populating.
 
J

JohnFol

If I were you I would break this down stage by stage.

For example, take a copy of the query so you can delete bits without
effecting the original.

Run the query in it's entirety and identify from the table a few records
that should appear but do not.

Then, remove each of the Where clauses until the records appear.
For example,

.. .. . WHERE (tbl_Ultrasound_CSPReport_061203.[List name]) Like "Mayo*")
AND (tbl_Ultrasound_CSPReport_061203.State ="mn")

and then
.. .. .
WHERE (tbl_Ultrasound_CSPReport_061203.State ="mn")

By doing this you can identify which clause is causing the record to be
filtered out. If you get down to no criteria, it could be the join, ie no
records on the many side.

Regards






Elizabeth said:
See attached SQL:
SELECT tbl_Ultrasound_CSPReport_061203.[List name],
tbl_Ultrasound_CSPReport_061203.City,
tbl_Ultrasound_CSPReport_061203.State,
tbl_Ultrasound_CSPReport_061203.Order,
tbl_Ultrasound_CSPReport_061203.[Caller Name],
tbl_Ultrasound_CSPReport_061203.[Clarify Number],
tbl_Ultrasound_CSPReport_061203.RePostingDate,
tbl_Ultrasound_CSPReport_061203.[Mn Wk Ctr],
tbl_Ultrasound_CSPReport_061203.[Purchase Order],
tbl_Ultrasound_CSPReport_061203.[Sales doc#],
tbl_Ultrasound_CSPReport_061203.[Product No],
tbl_Ultrasound_CSPReport_061203.[Product Serial],
tbl_Ultrasound_CSPReport_061203.[SumOfRepair Cost],
tbl_Ultrasound_CSPReport_061203.[SumOfTravel Cost],
tbl_Ultrasound_CSPReport_061203.Quantity,
tbl_Ultrasound_CSPReport_061203.[Cust Cost], CSP_Parts_1.
[Part No#], CSP_Parts_1.[Part Description]
FROM tbl_Ultrasound_CSPReport_061203 LEFT JOIN CSP_Parts
AS CSP_Parts_1 ON (tbl_Ultrasound_CSPReport_061203.[Cust
Cost] = CSP_Parts_1.[Cust Cost]) AND
(tbl_Ultrasound_CSPReport_061203.Order = CSP_Parts_1.Order)
WHERE (((tbl_Ultrasound_CSPReport_061203.[List name])
Like "Mayo*") AND ((tbl_Ultrasound_CSPReport_061203.State)
="mn") AND ((tbl_Ultrasound_CSPReport_061203.[Clarify
Number]) Is Not Null));


-----Original Message-----
What is the query you are running?




.
 

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