Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access 2003 Query Issue

Posted on 2015-02-05
11
Medium Priority
?
148 Views
Last Modified: 2015-02-06
I have a query in Access 2003 that is quite extensive.  When I run the query one of the criteria is not being met and it returns blank fields.  Is there a way that Access can tell me what criteria did not get met?  This way I can go straight to the problem and correct it.  Please advise and thanks!
0
Comment
Question by:submarinerssbn731
  • 5
  • 2
  • 2
  • +2
11 Comments
 

Author Comment

by:submarinerssbn731
ID: 40591858
Better yet can Access show the query return if the field is null or contains the criteria requested?
0
 
LVL 63

Expert Comment

by:☠ MASQ ☠
ID: 40593171
You could use "Is Null" or "Is Not Null" as the criteria for the query field.
Are your queries in MSSQL or DesignView?
Normally I'd just backtrack through the expression used to populate the field to find likely contenders that are now missing - depends just how "extensive" your extensive query is.
0
 
LVL 85
ID: 40593308
Can you post the SQL of the query?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:submarinerssbn731
ID: 40593481
SELECT [PSI Order Details].[Order Seq No], [PSI Order Details].[PO Number] AS PONumber, [PSI Order Details].PlantCode, [PSI Order Details].DLOC, BOM.CUSTNO, BOM.EC_LEVEL, [PSI Order Details].DockCode, CStr([Label Registry].Quantity) AS Qnty, [Label Registry].JobNo AS LotNo, [Label Registry].[Label ID] AS SN, [Label Registry].PSINO, [Label Registry].JobNo, [Label Registry].[Label ID] AS LabelNo, [Label Registry].[Label number] AS BoxNo, Format([DateProd],"mmmyyyy") AS FIFO, BOM.MATERIALID2 AS MatID, "113222074" AS MfgDUNS, BOM.PARTNAME, Tbl_Ship_to.DUNSCode, Format([DateProd],"yy/mm/dd") AS MfgDate, BOM.EC_DATE, BOM.CUSTCODE, Date() AS Today, BOM.PARTWEIG, [Label Registry].CartonLbs, Tbl_Ship_to.LocationCode
FROM (Tbl_Ship_to INNER JOIN (BOM INNER JOIN [PSI Order Details] ON BOM.PSINO = [PSI Order Details].PSINO) ON Tbl_Ship_to.SHIPTO = [PSI Order Details].[Ship To]) INNER JOIN [Label Registry] ON BOM.PSINO = [Label Registry].PSINO
WHERE ((([PSI Order Details].[Order Seq No])=[Forms]![frm_NEX_Labels]![lstDocIDs]) AND (([Label Registry].[Label ID])=[Forms]![frm_NEX_Labels]![LabelID]))
ORDER BY [Label Registry].JobNo, [Label Registry].[Label ID];
0
 

Author Comment

by:submarinerssbn731
ID: 40593485
Design view.
0
 
LVL 63

Expert Comment

by:☠ MASQ ☠
ID: 40593649
Are you getting one blank field (if so which one) or does the query return no results?
0
 

Author Comment

by:submarinerssbn731
ID: 40593657
returns no results.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 40593759
When you enter values on the form, are you sure there is a record that matches the values?

If you take the where clause off do you get data?

mlmcc
0
 
LVL 49

Accepted Solution

by:
Dale Fye earned 2000 total points
ID: 40593788
A couple of things to look at:
1.  You are joining 4 tables with inner joins, so you will only get records where there are related records in each of those tables.  If you don't get any records when you run your query without the WHERE clause, this could be the cause, in which case you should consider changing the joins to LEFT JOINs (without the WHERE clause) to help you determine which table is missing the matching records.

2. Have you checked to make sure that the fields you are using in your WHERE clause are of the same data type as the controls on the form?  You might want to consider actually declaring those form controls as parameters in your query, so that the data will be typed properly.
0
 

Author Closing Comment

by:submarinerssbn731
ID: 40594532
Great answer!  Thanks!
0
 
LVL 49

Expert Comment

by:Dale Fye
ID: 40594551
glad to help.

Can you share with us which of my recommendations solved the problem.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question