I have a table with the usual details about customers. I want a query to check to see if there are any customer birthdays within 5 days of todays date.
I put the following code into the Date of Birth field criteria:
Between DatePart("m",Date()) And DatePart("m",DateAdd("d",5,Date())) And Between DatePart("d",Date()) And DatePart("d",DateAdd("d",5,Date()))
However it did not return any results when it should have. Anyone know whats wrong with my criteria or how else i could do this?
Also, i am trying to figure out of way of making the query not show itself if it finds no records that match its criteria. I tried using a macro with the following code:
OpenQuery (Birthday Check Query)
Close Condition column: Count([Customer ID])=0
I have tried many variations (Dcount, Sum, Dsum) but it comes up with the error: "Can't find name 'Customer ID' you entered in the expression"
Any help will be appreciated
I put the following code into the Date of Birth field criteria:
Between DatePart("m",Date()) And DatePart("m",DateAdd("d",5,Date())) And Between DatePart("d",Date()) And DatePart("d",DateAdd("d",5,Date()))
However it did not return any results when it should have. Anyone know whats wrong with my criteria or how else i could do this?
Also, i am trying to figure out of way of making the query not show itself if it finds no records that match its criteria. I tried using a macro with the following code:
OpenQuery (Birthday Check Query)
Close Condition column: Count([Customer ID])=0
I have tried many variations (Dcount, Sum, Dsum) but it comes up with the error: "Can't find name 'Customer ID' you entered in the expression"
Any help will be appreciated