+ Reply to Thread
Results 1 to 5 of 5

Access function - TTM of data

  1. #1
    Forum Contributor
    Join Date
    03-06-2013
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2007, 2010
    Posts
    127

    Access function - TTM of data

    Hello all,

    Do any of you know the function/formula that will only query the last twelve months in an Access query? Based on the current month.

    Thanks.
    BrownBoy

    If happy, mark "SOVLED" & add to "REP"

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Access function - TTM of data

    You could use this criteria.

    [DateField]>=DateAdd("yyyy", -1, Date()) And [DateField]<=Date()
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    03-06-2013
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2007, 2010
    Posts
    127

    Re: Access function - TTM of data

    Thanks for the quick reply. The answer I get now is either "-1" or "0". Any ideas on what happened?

  4. #4
    Forum Contributor
    Join Date
    03-06-2013
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2007, 2010
    Posts
    127

    Re: Access function - TTM of data

    Got it, stupid mistake. Didn't add it to the criteria, I added it to the field. Stupid.

    Thanks.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Access function - TTM of data

    Glad you got it.

    By the way, I'm not 100% sure I posted the exact criteria you want but the function DateAdd is what you need for this sort of thing.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Need a function to access data in closed workbooks
    By Odlanier in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-07-2013, 06:28 PM
  2. Excel 2010 userform to access and edit the data in MS ACCESS DB tables
    By anand_y59 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2012, 07:46 AM
  3. Saving an Access for with Subforms as a Data Access Page?
    By danny2000 in forum Access Tables & Databases
    Replies: 1
    Last Post: 04-12-2009, 03:29 AM
  4. Importing data from Access to Excel, but I need to vary the table from Access
    By Liz L. in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-05-2006, 09:15 PM
  5. How do I access data stored in a SQL server for vlookup function?
    By M.Heer in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-12-2005, 05:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1