SQL -Date problem

Results 1 to 2 of 2

Thread: SQL -Date problem

  1. #1
    Charlie Bullit Guest

    Default SQL -Date problem

    I need a SQL-query that sort out all the records that are older then 3 months. How do I do?<BR><BR>SQLStmt = "SELECT * FROM Table1 Where (Date - Reg_date) =&#062; 3 Month " ????<BR>Set RS = Connection.Execute(SQLStmt)<BR><BR>The Reg_date field is a Date(now)field in an AccessDb and Date is todays date.<BR><BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    672

    Default RE: SQL -Date problem

    Use the dateadd functiondateadd("m",dateone,datetwo)or datediff(dateone,datetwo)http://msdn.microsoft.com/scripting/...c/glossary.htm for help.
    ________
    Launch Box Vaporizer
    Last edited by Jay; 04-16-2011 at 01:33 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
  •