S
Serendipity
* I have a qry that uses the information from 2 other queries with 2
calculated fields.
* The "base" queries are pulling thousands of records to just inspections
from 2009 rather than 5 years of data across multiple tables.
*The new query has fields from qry 1 with the first calculated field looking
to the qry 2 and calculating the difference in days from the inspection
date(qry 2) vs scheduled date(qry 1).
Form Received: DateDiff("d",[Scheduled Date],[InspectionDate])
* The second calculated field gives me a yes or no based upon the first
calculated field.
Inspection Received: IIf([form received] Between -40 And 60,"yes","no")
* Here is my problem: For an inspection scheduled I am getting multiple yes
and no's as I may have received more than one report for each location or
scheduled date which then plays have with the % received / not received
report. IE I have 1641 inspections scheduled, but I am getting 2185 yes / no
answers. How can I limit the query to not return the extras? example: WO
1234-12345 has a scheduled date of 07-02-09. I received inspection reports
for 07-31-09, 08-15-09 and 03-12-09 so I am getting 2 yes's and 1 no. I
would like it to stop comparing dates and returning additional yes / no's
once it returns yes, thus leaving me with the original 1641.
Thanks for all your help and assistance.
calculated fields.
* The "base" queries are pulling thousands of records to just inspections
from 2009 rather than 5 years of data across multiple tables.
*The new query has fields from qry 1 with the first calculated field looking
to the qry 2 and calculating the difference in days from the inspection
date(qry 2) vs scheduled date(qry 1).
Form Received: DateDiff("d",[Scheduled Date],[InspectionDate])
* The second calculated field gives me a yes or no based upon the first
calculated field.
Inspection Received: IIf([form received] Between -40 And 60,"yes","no")
* Here is my problem: For an inspection scheduled I am getting multiple yes
and no's as I may have received more than one report for each location or
scheduled date which then plays have with the % received / not received
report. IE I have 1641 inspections scheduled, but I am getting 2185 yes / no
answers. How can I limit the query to not return the extras? example: WO
1234-12345 has a scheduled date of 07-02-09. I received inspection reports
for 07-31-09, 08-15-09 and 03-12-09 so I am getting 2 yes's and 1 no. I
would like it to stop comparing dates and returning additional yes / no's
once it returns yes, thus leaving me with the original 1641.
Thanks for all your help and assistance.