Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
waqasaslammeo
Starting Member
1 Post |
Posted - 2012-01-19 : 03:49:55
|
| Hello Every one !i am trying to make query to show the growth of sale of the product month wise ,i have one table name Sales .having following fields , SalesID,ProductID,amt,Qty,SalesDatei use this query to show my recordsSELECT ProductID,Amt,Qty,substring (datename(month,SalesDate ),1,3)AS months,DATENAME(YEAR,salesdate ) AS yearsthis query shows my records in this way -------------------------------------------ProductID*****Amt*****Qty*****months*****years----------------------------------------------1****************400********6**********Dec**********20112****************300********4**********Jan**********2012----------------------------------------------I WANT TO SHOW MY RECORDS IN THIS WAY-------------------------------------------ProductID*****Amt*****Per.MonthQty*****Cur.MonthQty*****months*****years------------------------------------------------------------------------1****************400**********0****************6*************Dec******20112****************300**********6****************4*************Jan******2012------------------------------------------------------------------------sorry if you are feeling bad after reading it , can any one help me to solve this prob RegardsM.Waqas Aslamgive best get best |
|
|
whatamouth
Starting Member
16 Posts |
Posted - 2012-01-19 : 08:40:34
|
| Can you define the ff.-Per.MonthQty-Cur.MonthQtyNeil Matiasneilmatias@yahoo.com |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-01-19 : 09:01:36
|
It would be nice to have- the table structure- some sample data- the wanted resultfor example like this: No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|
|
|