Getdates between Specific dates

  • Hi,

    I am trying to do something like this :

    DECLARE @StartDate DATETIME

    DECLARE @EndDate DATETIME

    DECLARE @TodaysDate DATETIME

    SET @TodaysDate = GetDate()

    IF (@TodaysDate BETWEEN '8/21/2009' AND '9/24/2009')

    BEGIN

    SET @StartDate = '8/21/2009'

    SET @EndDate = GETDATE()

    END

    SELECT @StartDate

    SELECt @EndDate

    I want to get data between @StartDate and @EndDate .

    Please advise .

  • Would you mind doing some research before simply starting a new post?

    Just by using "dates between" as search criteria I found more than one solution that will answer your question.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • THANKS .

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply