Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004

    Unanswered: DateAdd function

    Hi guys,
    In Access u can do something like the following in ur query:

    WHERE (weekendingEmp.WeekEnding)>(DateAdd("ww",-3,Now()))

    Now() function will get the current system date.
    1st parameter which is "ww" means that it will add number of weeks to the current system date according to number specified by the 2nd parameter..
    so basically, this query will use DateAdd function as part of WHERE statement and collect data from 3 weeks ago up to today...

    unfortunately, i can't use Access object anymore and i need to use ADO.. i believe regular SQL statement doesn't understand "DateAdd" function so my question is.. does anyone kno how i can come around this problem w/out using DateAdd function?


  2. #2
    Join Date
    Apr 2004
    Kansas City, MO

    Re: DateAdd function

    It depends on the DB you are using. If you are using SQL Server, you can do the exact same thing with:

    WHERE (weekendingEmp.WeekEnding)>(DATEADD(ww,-3,GETDATE()))
    When life gives you a lemon, fire the DBA.

Posting Permissions

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