Results 1 to 4 of 4

Thread: date help

  1. #1
    Join Date
    Jun 2006
    Posts
    66

    Unanswered: date help

    can someone help me

    how can i pull all users from registration where date is

    1. between yesterday (always yesterday) and one week before. (by date not by time)

    2. the week before week 1
    3. week before week 2
    4. week before week 3

  2. #2
    Join Date
    Jul 2007
    Posts
    96
    SELECT *
    FROM dbo.users u
    WHERE u.registrationDate BETWEEN DATEADD(ww, -1, GETDATE()) AND DATEADD(dd, -1, GETDATE())
    ORDER BY
    u.registrationDate ASC;

    I'm guessing that you can figure out the rest on your own. If you can't please post what you've done so far so we can provide any further assistance.

  3. #3
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Get some flowers. Think of a few nice things to say to her, and take her to a nice place (McDonald's won't cut it here)....Oh, sorry. i was only going off the thread title. Nevermind.

  4. #4
    Join Date
    Jul 2007
    Posts
    96
    Quote Originally Posted by MCrowley
    Get some flowers. Think of a few nice things to say to her, and take her to a nice place (McDonald's won't cut it here)....Oh, sorry. i was only going off the thread title. Nevermind.
    Well spoted

Posting Permissions

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