Xan
2008-01-22 03:36:40 UTC
I'm trying to create a query in MS Access searching a table that has a date column; The criteria are taken from two text fields in a form. One is called Month whilst the other is Year.
Now what I want to do is to set the query, so that when one of the field is empty, the query will still do a search based on the other field. Instead of doing an 'AND' search as it is right now, which resulted in no result at all time.
E.g:
If Month is blank and Year is 2008, the query will search for all entry that were created in 2008.
If Month is 12 and Year is blank, the query will search for all entry that were created in December.
If Month is 12 and Year is 2008, the query will search for all entry that were created in December, 2008
i.e: Is there a way to create an if statement in the query that will check for a null value in a text field, and if it is true, just do a specific search criteria.
Any help will be much appreciated =D. Thanks!
-Xan