• Ok I'm going to make a wild guess and say they are looking for a CASE statement to determine the weekday.

    empid date val day name

    -----------------------------------

    1111 1/2/2008 1 Tuesday

    1111 2/2/2008 1 Wednesday

    1111 3/2/2008 1 Thursday

    1111 4/2/2008 1 Friday

    1111 5/2/2008 99 Saturday

    1111 6/2/2008 55 Sunday

    So

    CASE WHEN [day name] = 'Saturday' THEN 99 WHEN [day name] = Sunday THEN 55 ELSE 1 END

    At least I think that is part of it.

    Although if I were you I would re-post using Jeff's Best Pratcties for posting doc. It would make things alot easier to understand.

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]