Top deals

rave

New member
Local time
Today, 05:12
Joined
Mar 21, 2013
Messages
6
Hi,

I am working on a query (given below) where i need to pull data by sector and top # of records from table [APPS UK SALES FLASH MASTER QUERY].[Opty Id]. Also the top # of records will be an input from the user. How do i desigh it?


SELECT [APPS UK SALES FLASH MASTER QUERY].[UK Sector], [APPS UK SALES FLASH MASTER QUERY].[Opty Id], [APPS UK SALES FLASH MASTER QUERY].Account, [APPS UK SALES FLASH MASTER QUERY].Opportunity, [APPS UK SALES FLASH MASTER QUERY].Stg, [APPS UK SALES FLASH MASTER QUERY].[InterCo Tag], [APPS UK SALES FLASH MASTER QUERY].Probability, [APPS UK SALES FLASH MASTER QUERY].[Ctt Sign Date], Sum([APPS UK SALES FLASH MASTER QUERY].[Unweighted Bookings]) AS [SumOfUnweighted Bookings]
FROM [APPS UK SALES FLASH MASTER QUERY]
GROUP BY [APPS UK SALES FLASH MASTER QUERY].[UK Sector], [APPS UK SALES FLASH MASTER QUERY].[Opty Id], [APPS UK SALES FLASH MASTER QUERY].Account, [APPS UK SALES FLASH MASTER QUERY].Opportunity, [APPS UK SALES FLASH MASTER QUERY].Stg, [APPS UK SALES FLASH MASTER QUERY].[InterCo Tag], [APPS UK SALES FLASH MASTER QUERY].Probability, [APPS UK SALES FLASH MASTER QUERY].[Ctt Sign Date]
ORDER BY [APPS UK SALES FLASH MASTER QUERY].[UK Sector], Sum([APPS UK SALES FLASH MASTER QUERY].[Unweighted Bookings]) DESC;
 
Show us your tables and relationships.
Tell us about the "business" --what is the database suppose to support.
Tell readers in plain English WHAT the query is trying to do.
 

Users who are viewing this thread

Back
Top Bottom