• HOG (1/2/2013)


    Is it possible to run a query that uses a date range, but if the records do not have any data, to then go back six months before the start date?

    Whats the requirement for this? if you talk about query readability or simplicity then date/time range hardly would make any difference. and if we talk about performance perspective then

    1) it will search for say current 6 month if data is not there

    2) search for last 6 month.

    what i think here is , either you mention complete range (1+ 2) OR any logic which will first check in current 6 then last 6. in both cases resource consumption will be same (BUt if there is partioning setup then there will be boost in search process when data is lying on different disks )

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)