Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2006
    Posts
    7

    Functions in Query Criteria

    Hi!

    I'm wondering if I can use a function in the criteria in QBE. This is what my QBE looks like now:

    DatePart("m",[StartDate])
    ---------------------------------
    ---------------------------------
    Where
    ---------------------------------
    ---------------------------------
    9

    I'm pulling the month out of the StartDate field and selecting on the value of 9.

    What I want to do, instead of saying "9" is to say:

    DateAdd("m",-1,Date())

    (trying to get current month -1)

    I can't seem to make it work though. I get nothing back in my datasheet.

    Can this even be done? When I hardcode the 9 - I get the expected results.



    Thanks!

  2. #2
    Join Date
    Dec 2005
    Location
    Wilmington, DE - USA
    Posts
    275
    Try Month(Date()) - 1

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

Similar Threads

  1. Query Criteria
    By Texaine in forum Queries
    Replies: 1
    Last Post: 01-24-2018, 02:36 PM
  2. Query Criteria
    By jena in forum Access
    Replies: 1
    Last Post: 08-03-2008, 04:08 AM
  3. Query Criteria
    By jena in forum Queries
    Replies: 1
    Last Post: 04-29-2008, 11:00 AM
  4. Need help with tables and query criteria
    By DevintheDude in forum Access
    Replies: 0
    Last Post: 09-12-2007, 08:41 AM
  5. Criteria in Crosstab Query
    By wasim_sono in forum Queries
    Replies: 1
    Last Post: 12-12-2006, 05:14 AM

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