Re-Write this query

  • Thread starter Thread starter Karen
  • Start date Start date
K

Karen

I have this query that is the record source for a form
that list all the Errors that occurred during the scanning
of documents.

Does anyone have any idea how this could be written
different? The problem is that the SSNO and date are
always null to begin with so the null statement is written
everytime. My users want this to go away and only show up
when it is valid.

Anyway here is the SQL statement:
SELECT IIf(IsNull([scannerinputdata].[SSNO]),"Bad FormXREF
SSNO or No Matching Employee ") & IIf(IsNull
([scannerinputdata].[xdate]),"Scanner Date Error") AS
Error, FormXREF.SSNO AS [FormXREF SSNO], FormXREF.DATE AS
[XREF Date], ScannerInputData.SSNO AS [Scanner SSNO],
ScannerInputData.XDate AS ScannerDate,
ScannerInputData.Header508, ScannerInputData.Printer,
ScannerInputData.N001, ScannerInputData.DateRead,
ScannerInputData.FormCode, ScannerInputData.Stuff,
ScannerInputData.FormName2, ScannerInputData.FormNo,
ScannerInputData.FormName, ScannerInputData.Field1,
ScannerInputData.Field2, ScannerInputData.Field3,
ScannerInputData.Field4, ScannerInputData.Field5,
ScannerInputData.Seq, ScannerInputData.Seq
FROM ScannerInputData LEFT JOIN FormXREF ON
(ScannerInputData.FormNo = FormXREF.FormNo) AND
(ScannerInputData.FormName2 = FormXREF.FormID)
ORDER BY ScannerInputData.Seq;


Thanks for all the help.
Karen
 
So write yourself a query that returns all columns from
both tables where the fields in question are null.

Take any row of the result and ask yourself "What is it
about this row that tells me this is a "valid" row?".

If you can't tell, then your question has no answer and
you will have to think of some way to add another column
to one of the tables that gives the information you need
 
Back
Top