Ask Experts Questions for FREE Help!
 

Free Answers in 3 Easy Steps

Register Now
3 Steps
 


Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.
  View Answers    Answer this question    Ask a question  
 

jakester
Apr 28, 2009, 01:27 PM
Okay - any takers?

Here's my deelemma. I have a query that I'm trying to create which would allow me to query 4 date fields by Month and date only. Here are the following date fields:

Renl Date
Cancel Date
Conversion Date
X-fer Date

I want to query by Month and date only (not by year) for each of these date fields. So, for example, I would want to see records by 02/01/xx.

Would I have to write this in SQL or can I query this in the "Criteria" field of the query design view? By default, the query design keeps putting the year in as 09, but I want to pull all records with a 2/1 effective date just records in 2009. Here is the SQL code in my SQL view:

SELECT [ASO Master List].Policy, [ASO Master List].[Customer Name], [ASO Master List].[REN Date], [ASO Master List].[Cancel Date], [ASO Master List].[Transfer Date], [ASO Master List].[Conversion Date]
FROM [ASO Master List]
WHERE ((([ASO Master List].[REN Date])=#2/1/2009#)) OR ((([ASO Master List].[Cancel Date])=#2/1/2009#)) OR ((([ASO Master List].[Transfer Date])=#2/1/2009#)) OR ((([ASO Master List].[Conversion Date])=#2/1/2009#))
WITH OWNERACCESS OPTION;

Thanks for taking a stab at this.

ScottGem
Apr 28, 2009, 04:13 PM


Your approach is worng. What you need to do is add some columns to your query. For example:

RenewalMonth: Month([Renl Date])
RenewalDay: Day([Renl Date])

Then create a form with two controls to enter (select) the month and day.

Finally, set the criteria for each of these columns using the syntax:

=Froms!formname!controlname

The query will then return any records that match the enetered month and day irrespective of year. If you need to supply different month/day combinations for different dates, then just use more textboxes.