If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Report using "Max" command
I have designed a report based on a query which includes, among other fields,
2 fields call "Amount Pledged" and a field called "countofFrequency". EG of entries as follows Amount Pledged $100, Frequency 2 Amount Pledged $200, Frequency 4 I have created a text box to try and get it to list the Amount Pledged based on the Maximum Frequency number, but cannot seem to get the code right. Any help would be appreciated. |
#2
|
|||
|
|||
Report using "Max" command
You could create a new query based on that query:
SELECT TOP 1 [Amount Pledged], countofFrequency FROM MyQuery ORDER BY countOfFrequency Desc Alternatively, you could use: SELECT [Amount Pledged], countofFrequency FROM MyQuery WHERE countofFrequency IN (SELECT Max(countofFrequency FROM MyQuery) Note that if the highest frequency applies to more than one Amount Pledged, both queries will return more than one row. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Roger Bell" wrote in message ... I have designed a report based on a query which includes, among other fields, 2 fields call "Amount Pledged" and a field called "countofFrequency". EG of entries as follows Amount Pledged $100, Frequency 2 Amount Pledged $200, Frequency 4 I have created a text box to try and get it to list the Amount Pledged based on the Maximum Frequency number, but cannot seem to get the code right. Any help would be appreciated. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
subreport not displaying in main report | JohnLute | Setting Up & Running Reports | 15 | November 17th, 2005 04:02 PM |
Reporting subreport total on main report | BobV | Setting Up & Running Reports | 22 | November 1st, 2005 03:19 AM |
Has anyone seen this behaviour? What might it be? | tw | General Discussion | 4 | June 30th, 2005 03:23 PM |
Still Hoping for help with a Query problem | Don Sealer | Using Forms | 15 | November 13th, 2004 06:24 AM |
Open a report based on which query I select | Sierras | Setting Up & Running Reports | 8 | June 24th, 2004 05:43 PM |