I am working on a project where I need to generate a monthly sales report. In have two table one with customer information like Cust_id, Cust_name, etc. and other with invoice amount info like Cust_id, Sale_Date, Amount, etc. Now in the report I need to show Customer wise monthly sale report where user will give me input for how many months he wants report for suppose User inputs 6 then I need to show previous 6 months sales report. Now after extracting this report I need to display a column for each month in the report like for 6 months
Name Sep. Aug July June May April
Sam 1000 100 - 900 - -
John 500 235 764 - 43 -
Bill 3333 - - 1129 8888 4312
I Hope I have explained the question in the best possible way I could have done. But if u need any clarification you can ask me.
I need a query for this
Can any one help me.
Thanx in advance..