Results 1 to 4 of 4
  1. #1
    Risto85 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    13

    Query using date from form and subtracting 1 day

    Hello



    I have a query that reads the date criteria from user form. I use formula
    Code:
    Like [forms]![Userform].[Date1] & "*"
    . So when user inputs 14.03.2015 then query displays everything with criteria 14.03.2015. I would like to query do display everything from day before. So in this example case query should display everything with date criteria 13.03.2015

  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,722
    If the criteria is not correct, then change the criteria.
    You have to determine exactly WHAT the condition/criteria is and then code it and test the query appropriately.
    You may want to research the DateAdd function (to subtract 1 day from a Date value).
    Good luck.

  3. #3
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    How about:
    Code:
    [Forms]![Userform].[Date1] - 1

  4. #4
    Risto85 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    13
    Orange, got it working using dateadd function
    JoeM, thank you for providing idea , but unfortunately it displayed query empty.

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

Similar Threads

  1. Date Query: Annual Data Based off of Form Date
    By steveabni in forum Queries
    Replies: 4
    Last Post: 04-21-2014, 02:15 PM
  2. Subtracting a date/time field from a number to get date/time
    By Lifeseeker1019 in forum Programming
    Replies: 4
    Last Post: 03-28-2014, 12:59 PM
  3. Replies: 3
    Last Post: 03-26-2014, 10:49 AM
  4. Adding and subtracting dates from current date
    By brianmcleer in forum Access
    Replies: 1
    Last Post: 05-07-2013, 05:15 PM
  5. subtracting the value of fields in a form
    By petterros in forum Forms
    Replies: 0
    Last Post: 01-14-2011, 11:46 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