Results 1 to 2 of 2
  1. #1
    mejia.j88 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Location
    california
    Posts
    228

    Question date subtraction in query

    I have the following criteria for a date field:

    Between ([Forms]![frm_rptInspectionShiftYield_ByDateRange]![txtStartDate]) And ([Forms]![frm_rptInspectionShiftYield_ByDateRange]![txtEndDate])

    my date field is formatted as: Expr1: CDate(Format([glassing_yield].[date_time],"mm/dd/yyyy"))

    i want the query to pull records from 4 days before the start time, i tried using adding a -4
    Between ([Forms]![frm_rptInspectionShiftYield_ByDateRange]![txtStartDate] - 4) And ([Forms]![frm_rptInspectionShiftYield_ByDateRange]![txtEndDate])

    error is my expression is typed incorrectly, or it is too complex to be evaluated. how can i do this substraction?



    furthermore, if i want to get the data for 3/28/12, i have to put 3/28/12 as a start date, and 3/29/12 as an end date. Is there a way to modify this to where i would enter 3/28/12 as the start AND end date?

    thanks guys

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Can you post a copy of the DB here?
    It would be easier for me than trying to replicate your scenario.

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

Similar Threads

  1. Calculation in Code Builder for Sum & Subtraction
    By braveali in forum Programming
    Replies: 19
    Last Post: 03-07-2012, 12:32 AM
  2. Replies: 2
    Last Post: 02-02-2012, 12:18 PM
  3. subtraction between records
    By JJCHCK in forum Programming
    Replies: 5
    Last Post: 10-11-2011, 12:57 AM
  4. query to update a date based on another date
    By tkendell in forum Access
    Replies: 3
    Last Post: 06-29-2011, 09:32 PM
  5. Replies: 2
    Last Post: 07-31-2009, 06:56 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