Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2009
    Posts
    3

    Red face Unanswered: MS Acess Date Functions

    I have requirment where i need to check 2 things.

    This condetion is for where

    clause to get the data between two dates and also going back to date minus one.

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    This probably should be in the Access forum. Presuming you have your two dates on a form, you'd want something like

    Between Forms!FormName.txtFromDate And Forms!FormName.txtToDate
    Paul

  3. #3
    Join Date
    Mar 2009
    Posts
    3
    Thanks Paul!!!!

    Yes i have used the between function for the dated adding to it i need to do date minus one as well

    how to combine both the formulas ???

  4. #4
    Join Date
    Mar 2009
    Posts
    3

    Question

    I have to do

    between the dates needs to have the -1 day added to make it work

    i am clueless how the sql will be done on this

    Help!!!

  5. #5
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    I'm not clear on what you're asking. You want to subtract one from the current system date (Date() function) or from the user input date? Either way you can use the DateAdd() function or simply subtract 1.
    Paul

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    What's wrong with
    Code:
    WHERE  some_date >= Forms!FormName.txtFromDate
    AND    some_date <  Forms!FormName.txtToDate


    Moving to Access topic
    George
    Home | Blog

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    the problem is more liekly to be the todate, as if the date column in the db contains a time value (ie you have used now(), instead of date() to store the date, then you wat to add one day to the upper limit

    eg
    WHERE some_date >= Forms!FormName.txtFromDate
    AND some_date < datedd(d,1,Forms!FormName.txtToDate)
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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