Can someone tell me how to write this query? Thanks

  • Maybe I posted to the wrong forum, here is the original post copied from "SQL Server 2005 - T-SQL (SS2K5)"

    http://www.sqlservercentral.com/Forums/Topic1211666-338-1.aspx

    Good day,

    I have a table with a timestamp for each record, I have a need to select the records based on three scenarios:

    1. Since Last Year (since 365 days before current day)

    2. Since Year to End (starts from Jan 1 of current year)

    3. Since Fiscal Year (starts from Nov 1 of current year)

    My where clause will need to include this selection criteria. I guess I need to use "case " in it.

    Can someone tell me how to write this query?

    Many thanks. 😉

  • see my reply on your original post.



    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]

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

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