Results 1 to 4 of 4
  1. #1
    ssalem is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Feb 2013
    Posts
    39

    Month and Day only not Year to create query

    I am trying to creating 2 queries of my Permit renewals of Permits that are expiring in 15 and 30 days. My issue is that the Date on file is the original date the Permit was opened and comes up for renewal on the same month and day but not year. So i need to query on -15 days and -30 days back from the date the permit was opened.



    Im rather new at this and just cant seem to get the right results. In my query under the criteria option of [Bulk Fee Paid] i put. (month(date()) & day(date())) - 15 = (month([Bulk Fee Paid]) & day([Bulk Fee Paid])

    I also tried dateadd("d",-15,date()) in the [Bulk Fee Paid] criteria.

    I am not sure what I need to do...but I am pretty sure it can be done.

    Any quidance would be apprectiated.

  2. #2
    ssalem is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Feb 2013
    Posts
    39
    Ok I figured it out. This is what I had to do.

    I made two expressions in the query, one pulling the month useing datepart("m",[Fieldname]) and one datepart("d",[Fieldname])
    Then within the expressions on criteria I put datepart("m",date()-15) and datepart("d",Date()-15)

    My query returned all dates 15 days before my Fieldname expired without looking at the year.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,920
    So you need to calculate the renewal date (1 year from issue date?) then apply criteria to retrieve records that are due in the next 15 or 30 days?

    RenewalDate: DateAdd("y",1,[Bulk Fee Paid])

    Can build one query with a parameter that references textbox on form for criteria. Criteria under the calculated field to return renewals due in the next 15 or whatever days:

    Between Date() And Date() + Forms!formname!textbox
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    ssalem is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Feb 2013
    Posts
    39
    Actually the date on the database is the date they opened the permit no matter what year it was. It always renews on the same day even if it is overdue. It does not change the Paid Fee. Their renewal date always stays the same, even if they pay it 1 month or 2 months late. That date will never change. Every year I need to send out a notification that the permit is coming up for renewal. A 30 day notice and a 15 day notice reminder.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Year to DATE by Month
    By lugnutmonkey in forum Queries
    Replies: 1
    Last Post: 01-18-2013, 05:37 PM
  2. Replies: 4
    Last Post: 07-30-2012, 11:55 AM
  3. Query / report per month and year
    By ripper in forum Queries
    Replies: 2
    Last Post: 10-24-2011, 07:51 AM
  4. Replies: 0
    Last Post: 03-25-2011, 02:37 PM
  5. by year by month
    By nkuebelbeck in forum Reports
    Replies: 21
    Last Post: 03-24-2010, 01:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums