Cash Payments By Denomination

  • Comments posted to this topic are about the item Cash Payments By Denomination

  • I'd prefer a single UPDATE statement:

    UPDATE raa

    SET tt_TotalPay = aan.TotalPay,

    tt_CountOf100s = aan.TotalPay / 100,

    tt_CountOf50s = aan.TotalPay % 100 / 50,

    tt_CountOf20s = aan.TotalPay % 100 % 50 / 20,

    tt_CountOf10s = aan.TotalPay % 100 % 50 % 20 / 10

    FROM #RefsAndAmounts raa

    CROSS APPLY (

    SELECT tt_GameCount * 20 AS TotalPay

    ) AS aan --assign_alias_names

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

  • Thanks for the nice script.

  • Thanks to everyone for the positive and helpful feedback. This was my first submission ... it was fun!

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

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