vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, Need help in writing the query to acheive the following results. Here the data :- Date DB Amt 1/7/2005 SalesDB 60000 1/15/2005 SalesDB 70000 1/25/2005 SalesDB 80000 02/01/2005 SalesDB 3000 02/15/2005 SalesDB 5000 02/31/2005 SalesDB 8000 I want the output in following format Month DB Amt 1 SalesDB 20000 2 SalesDB 5000 1. Group by month and database. 2. Subtract the max(Date)'s Amt with min(Date)'s Amt (eg 80000-60000 and 8000-3000) Thanks in advance Suraj |