2
Answers

Need Help For Grouping the Rows

Krishna Kumar

Krishna Kumar

7y
263
1
Dear all,
I have a table like below
date                    bill_desc              amount
17-04-2017        RoomCharge        250.00
17-04-2017        BreakFast                80.00
17-04-2017        ExtraBed              120.00
17-04-2017       WaterBottle              30.00
Noe I want to sum the amount of Roomchage and description and display it as RoomCharge and remaining chrges are ther to be displayed.
date                       bill_desc                    amount
17-04-2017          RoomCharge           330.00 (RoomCharge + Breakfast)
17-04-2017          ExtraBed                  120.00
17-04-2017          WaterBottle              30.00
I need to group the data by date.. can anyone help me to acheive this. I have an idea that this will be acheived by case statement, But i dont know how to prepare that or you can suggest me the other method
Thank You in Advance
Answers (2)
0
Vikram
NA 319 262.4k 14y
Hi yashwant,
  
    Just Define variable in the Markup it consider as Global.

e.g
  
   <script type='text/javascript>
       var Navigateurl="~/block/abc.aspx";
         function pageLoad()
         {
                 //do something
         }

         function otherFunction()
        {
            var newurl = Navigateurl;
        }

</script>
This way you can declare the global variable in the markup.

Hope this will help you.

Regards,
 Vikram