Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2012
    Posts
    19

    Unanswered: DATE_SUB(WEEK) specifying date mode

    Really simple question I want to change the date mode but cannot figure out how to do it while using date_sub. I know the below is wrong, so how do I do it?

    Code:
    SELECT meetings.date
    FROM meetings
    WHERE WEEK(meetings.date,1) = DATE_SUB(WEEK(CURDATE(),1,INTERVAL 1 WEEK))

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Date_Sub() is not a SQL Server function.
    Perhaps you are using MySQL?

    The equivalent in SQL Server is DateAdd() [but using negative numbers]
    George
    Home | Blog

  3. #3
    Join Date
    Jun 2012
    Posts
    19
    Ahh sorry I have posted in the wrong forum! Yes I am using MySQL, thanks I will pop it over there

Posting Permissions

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