Query not being consistent (1 Viewer)

Fasopus

Registered User.
Local time
Today, 12:56
Joined
Jun 9, 2010
Messages
58
Query not being consistent [Resolved]

This is really confusing me. I have a form where a name is given along with two dates. Then a button is pressed which opens a report, the data source for the report is a query. The query uses the name given alongside the two dates to find all the errors that person has had between the two dates inclusive. However it is acting funny, it seems like everytime the query is run it returns something different. One example that is particulalry bothersome to me is that in my samples I have errors for one person on 8/3/2010 and 8/5/2010. If i set the range from 8/3/2010 to 8/5/2010 it works. If i set it to go from 8/3/2010 to 8/18/2010 nothing comes up, but then if i set it to go 8/3/2010 to 9/4/2010 ,for example, it works again. This is really confusing me and I dont understand why this is happening.

Heres by SQL
Code:
SELECT LiftTruckErrors.ID, LiftTruckErrors.FullName, LiftTruckErrors.Occured, LiftTruckErrors.Reported, LiftTruckErrors.[Machine#], LiftTruckErrors.MachineType, LiftTruckErrors.Alias
FROM LiftTruckErrors
WHERE (((LiftTruckErrors.Occured)>=[Forms]![Find Lift Truck Errors]![Text14] And (LiftTruckErrors.Occured)<=[Forms]![Find Lift Truck Errors]![Text16]) AND ((LiftTruckErrors.FullName)=[Forms]![Find Lift Truck Errors]![Combo10]))
GROUP BY LiftTruckErrors.ID, LiftTruckErrors.FullName, LiftTruckErrors.Occured, LiftTruckErrors.Reported, LiftTruckErrors.[Machine#], LiftTruckErrors.MachineType, LiftTruckErrors.Alias;

Thanks in advanced


EDIT: Working on this even more is just further baffling me. I simplified the query so that it just finds ALL errors after a given date, and it still doesn't work properly, but if I change the date forward or back a day (mind you I am no where near the boundry of the data I am looking to retrieve) it will sometimes work. It just makes zero sense, I look in the table and I can see 8/5, 8/11, 8/12 entries but If I say everything after 8/4 only 8/5 is returned

Resolved: Boy do I have egg on my face, remember kids, when you make a new table you should always check that your data types are properly set BEFORE starting to develop querys and forms to run off of it.
 
Last edited:

Users who are viewing this thread

Top Bottom