Home Forums SQL Server 2008 T-SQL (SS2K8) How to count the total sales prior's 4 weekend if user give the weekend date. RE: How to count the total sales prior's 4 weekend if user give the weekend date.

  • 2011-12-182011-12-192011-12-202011-12-212011-12-222011-12-232011-12-24

    Sunday Monday Tuesday WednesdayThursdayFriday Saturday

    Now let me ask you this .. assume the user inputs the date of 2011-12-21 which is a Wednesday... and you asked

    it should take the closer weekend date for the given date.

    Which do you think is the closer weekend the 24th or the 17th ?

    Now if the user inputs an incorrect date and does not realize the incorrect input, and you correct it, will the user really be returned the data that they thought they asked for ?

    If they are not informed, incorrect decisions could be made. Now I know this is taking the answer out of the realm of T-SQL, but isn't it our job as DBAs / Developers to provide the best support we can ?

    Let me put it another way, the user gets the data, deduces that the sales volume is not sufficient enough to give you the DBA a pay raise, all because the user input an incorrect date and was not informed of making that error.

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]