Results 1 to 2 of 2
  1. #1
    tmcrouse is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    169

    Date Help

    I have a query that I am trying to construct and a bit confused on how I should construct the date. I have the following columns with data in my table:

    sysid
    dischargedate
    firstservicedate
    proc



    I want to have the query to compare the dischargedate and firstservicedate and return any sysid where the firstservicedate is 30days greater than the dischargedate

    so i would think putting something like [dischargedate]>31[firstservicedate] in the firsetservicedate area??? not sure. really confused on this one.

    or how about [dischargedate] >=[firstservicedate]>31

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    In SQL view try

    ...WHERE firstservicedate - dischargedate > 30

    You could also use the DateDiff() function in a new field and put your criteria there (>30)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 12
    Last Post: 04-26-2012, 04:01 AM
  2. Replies: 1
    Last Post: 12-12-2011, 06:32 AM
  3. Replies: 1
    Last Post: 12-07-2011, 01:02 PM
  4. Replies: 1
    Last Post: 07-07-2010, 04:22 PM
  5. Replies: 1
    Last Post: 12-09-2005, 10:29 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