Results 1 to 4 of 4
  1. #1
    Shilabrow is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    May 2014
    Posts
    34

    Get data - 3 months to Date


    I am trying to get data for 3months to date. I have the following but I get error when I used the below query for my date criteria. What am I doing wrong. All help appreciated in helping me retrieve all 3months data to date using computer reference time. Thanks

    DateDiff("m\on\th","datecolumn",getdate()<=3)

  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,870
    I would suggest a SELECT query with
    a) WHERE DateColumn Between Date - 90 and Date
    b) Where DateDiff("m",DateColumn, Date) <=3

  3. #3
    Shilabrow is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    May 2014
    Posts
    34
    Thanks orange, I get Error: Data type mismatch in criteria expression.

  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,870
    I think it's telling you that DateColumn is not a Date/Time datatype.

    Check - what is the data type of the datecolumn field in your tabel?

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

Similar Threads

  1. Replies: 3
    Last Post: 02-23-2014, 02:06 PM
  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