Ask Experts Questions for FREE Help !
Ask
    jakester's Avatar
    jakester Posts: 582, Reputation: 165
    Senior Member
     
    #1

    Apr 28, 2009, 01:27 PM
    Database query
    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's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #2

    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.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search


Check out some similar questions!

Hotmail database [ 3 Answers ]

Can anyone help me finding full database of hotmail email ids.

DNS Query Query. A Query about DNS Queries... [ 12 Answers ]

I am a software developer, I don’t know much about networks. I have a working network but with one weird (well to me it’s weird) problem. If you can offer any insight I’ll be very grateful! <!--- Image Attachment Below (I couldn't find a way to paste it here in the editor :-( ) ---> ...

Database [ 2 Answers ]

Hi there! I would like to have some detailed information about This topic:- Specify the hardware needed to support Database system, supporting your reasoning with argument and a detailed rationale. Waiting for your reply Cheers Reetika

Database [ 1 Answers ]

In a database I have inputed a subform. The subform adds up totals of plants by adding Price*quantity. That is fine, the problem I have is that I want to have a box that adds up all the plants totals to give an overal price. Anyway you can help me? Thanks


View more questions Search