Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 2nd, 2012, 12:22 PM
Authorized User
Points: 308, Level: 6
Points: 308, Level: 6 Points: 308, Level: 6 Points: 308, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2009
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default Maximum as a criterion in an Access Query

I need to query a table that contains results of surveys for various pieces of property. One of the fields will be number, beginning with 1, that indicated which survey this set of data represents. I will definitely at times want the data from the first survey and that is an easy query.

But what about when I was the last (highest number) query on a property? That is, for the survey number field, rather than putting in a number (because each property has a different nunber of surveys and I don't readily know how many surveys a given piece of property has had) I want to use the equivalent of MAX in Excel. That is, my criteria for that field is to find the record where that field has the largest value.

If I am not clear, I may have 7 entries for various surveys done over time for Property A. Then again, I may have only two surveys or as many as dozens. I know I could easily run a query to show me how many there are so I would no the highest number used for Property A, but that is a pain to do.

So the question is, can I just put Max or Maximum into the query criterion box for the SurveyNumber field and Property A in that field and get the survey results I am looking for, that is the results for the last survey entered?
Reply With Quote
  #2 (permalink)  
Old March 2nd, 2012, 12:26 PM
Authorized User
Points: 308, Level: 6
Points: 308, Level: 6 Points: 308, Level: 6 Points: 308, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2009
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default Posted in the wrong forum

I posted this in the wrong place and do not know how to delete it from this section. I apologize to all.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
where clause/criterion sauloftarsus SQL Server 2005 0 November 23rd, 2011 04:15 AM
Update query doesnt run when Select query does (In MS Access) rmccafferty SQL Language 3 February 11th, 2010 04:54 AM
Maximum Users Brendan Bartley Access 1 March 15th, 2007 02:34 PM
Row Maximum bmains SQL Server 2000 2 October 7th, 2004 08:39 PM
Finding the maximum and using it outside the IF jrwarwick XSLT 2 October 17th, 2003 03:59 AM



All times are GMT -4. The time now is 10:49 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.