Results 1 to 4 of 4
  1. #1
    stevekroll is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    16

    Date Functions to get first three months of year or any 3 consecutive months

    For a filter condition, I want to use the date function DatePart() to get only the records for the first three months of the year or any three consecutive months. I am not sure how to enter the date component(m, q) in the date DatePart function to achieve this.

    Is this correct for first three months/first quarter?

    DatePart ("q", [DatePlaced])=DatePart("q=1), Date()) set q=1 for first quarter?
    and DatePart("yyyy" [DatePlaced])=DatePart("yyyy", Date())

    Is this correct for any three consecutive months from today?

    DatePart ("m", [DatePlaced])=DatePart("m=4,5,6", Date())


    and DatePart("yyyy", [DatePlaced])=DatePart("yyyy", Date())

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    Did you try It? What result?

  3. #3
    stevekroll is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    16
    I don't have Access at home. It will wait till tomorrow in the office. Just wanted to know if i was on the right track.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    You can find Access/vba functions and sample usage at TechOnTheNet

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

Similar Threads

  1. Replies: 3
    Last Post: 05-12-2012, 04:52 AM
  2. Substracting months to a date
    By ruthib4 in forum Queries
    Replies: 2
    Last Post: 12-21-2011, 10:11 AM
  3. Replies: 1
    Last Post: 11-12-2010, 01:16 AM
  4. Replies: 11
    Last Post: 08-04-2010, 04:26 PM
  5. Query criteria, add 5 months to date
    By thart21 in forum Queries
    Replies: 1
    Last Post: 03-29-2010, 05:09 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