Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21839

Help with query

$
0
0
Im working with SQL table, which have data of Parts names, along with Price of the parts. My table have the following Column; Part Descr, Qty, Cost.
This table keep data for the whole year, but lets say, I wont to retrieve only febuary data that have the Top 10 highest amount price thru the month of febuary.




SELECT Top 10
[Part Descr],
SUM(Qty * Cost)AS [Total Amount]
FROM [Report_Table].[dbo].[Reports]
where
[Date] >='20130201'AND [Date] <='20130228'
GROUP BY [Part Descr]

This query gives me the top 10 most shown [Part Descr], but I wont to get the Top 10 parts that cost the most in the month of Febuary.

Viewing all articles
Browse latest Browse all 21839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>