Customer Code | Name | Spent2011 |
xyzaa | Jon | 700.00 |
nmcb | Stuart | 400.00 |
bncx | Prakash | 300.00 |
nmsd | Srinu | 200.00 |
opkls | Kumar | 90.00 |
Table above as retrieved data For Site 01
Rank the customers by top spent for 2011 or 2012 or 2013 or 2014
Ex: A Financial year 2011 to be considered between the dates April 1<sup>st</sup> 2011 and Marc 31<sup>st</sup> 2012
- Customer table has the complete details of the customer and with unique customer code
- Order Table has the details of the order placed and the Order Placed Date
- Order Item Table has the Gross price of each Item.
- Site Table can be joined with Order Table (has a common column)
A T-SQL query for the SSRS report needs to be build with Inputs site code and Year