A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Report using "Max" command



 
 
Thread Tools Display Modes
  #1  
Old November 19th, 2005, 08:16 AM posted to microsoft.public.access
external usenet poster
 
Posts: n/a
Default 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  
Old November 19th, 2005, 11:42 AM posted to microsoft.public.access
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 08:31 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.