Query with changeable date inputs not retrieving any/correct records.

I’ve created a database for our warehouse staff to log what xray screening they do. Got all the data being input correctly including two fields, one for what date and time they started screening and one for what date and time they finished.

The time is required – we need to monitor how long they spend screening.

I’ve then set up a query to pull out information from The main data sheet based on the screeners name and whether it passed or failed. Plus the two date fields.

The search boxes (combos and date selectors) are in a main form, the data is displayed in data sheet form in a subform.

Now for retrieving the data we don’t need to specify the time just what date it occurred on.

This is where I’m running into trouble.

Every time I select any type of date it displays no records.

I’m using the query builder with where criteria. I’ve looked around online and read about using >= etc but it doesn’t work. I’ve tried adding # but it throws a fit about it not being a proper date format. I’ve tried () no (). I’ve tried BETWEEN.

A lot of online solutions seem to assume I want the query to always run with specific dates – I don’t, I need it to run with whatever dates are selected in the main form.

I did have some isnull criteria to force the form to display all records if no criteria was selected. But I’ve removed a few of them as I think they were unnecessary and possibly confusing the query.

It’s really frustrating me. This is one of the last steps I need to complete before I hand it over to the screeners for testing and it’s taken me long to not find a solution than it has to build the rest of the database on the first place!

I’d like to stick with using the query builder if possible but if I absolutely have to I’ve got very basic understanding of VBA.

Thanks!

submitted by /u/likeafuckingninja
[link] [comments]

Posted on