J
Julio Sarmiento
Can anyone help me????
I have a table that I need to get the sum of four individual fields and then
rank them from highest to lowest total. After summing up the four fields
individually and ranking them, I have to place them in a single datagrid.
Example:
Table: contains fields for Revenue, Quantity, Credit Apps, Accounts by
rep (not my table!!!)
SQL Statement: Select sum(Revenue), Sum(Quantity), Sum(CreditApps),
Sum(Accounts)...
Rank each column individual from highest Revenue to Lowest, from highest
quantity to lowest etc...
My solution was to query the tables four time (1 for each field) hence
creating four datasets. I then have a sub routine that adds a field titled
Rank to each dataset and adds the sequence number for the ranking.
NOW, I have to join the four tables but not as parent - child but as
additional fields for the same table
Outcome: Total Revenue, Ranking, Total Quantity, Ranking, Total Credit
Apps, Ranking, Total Accounts Ranking...
HOW DO I DO THAT???? HELP???
Deadline looming near!!!
Thanks,
Julio
I have a table that I need to get the sum of four individual fields and then
rank them from highest to lowest total. After summing up the four fields
individually and ranking them, I have to place them in a single datagrid.
Example:
Table: contains fields for Revenue, Quantity, Credit Apps, Accounts by
rep (not my table!!!)
SQL Statement: Select sum(Revenue), Sum(Quantity), Sum(CreditApps),
Sum(Accounts)...
Rank each column individual from highest Revenue to Lowest, from highest
quantity to lowest etc...
My solution was to query the tables four time (1 for each field) hence
creating four datasets. I then have a sub routine that adds a field titled
Rank to each dataset and adds the sequence number for the ranking.
NOW, I have to join the four tables but not as parent - child but as
additional fields for the same table
Outcome: Total Revenue, Ranking, Total Quantity, Ranking, Total Credit
Apps, Ranking, Total Accounts Ranking...
HOW DO I DO THAT???? HELP???
Deadline looming near!!!
Thanks,
Julio