Max


Hi all

I'm doing a qry in design view.

I have a bunch of students in grade 1 to 7. I want to find all students in the highest grade e.g 7. I could just enter 7 in the query criteria. And everything is hunky dory. But if things change and the highest grade is 6.... Then the query doesn't work.

Any ideas as to how I can list all records with students in the highest grade (or maximum grade\t)

I played with the Max function... but I'm doing something wrong. I appreciate any ideas.
Posted On: Monday 22nd of October 2012 05:58:18 AM Total Views:  275
View Complete with Replies

RELATED TOPICS OF Microsoft Access PROGRAMMING LANGUAGE




Selecting max from a column

a al, ive got a problem with my select max statement. What i want to do is select the maxium value from my table- howver its not returning the maximum value- Instead its returns a middle value e.g. the number 1-50 in my column in my db. I want 50 to appear but it only displays the number 10\t Heres my sql statement- pls i need some advice or code Code: sub sqlCmd( ) '==SQL STATMENT=========================================================================== set objrs2 = server.createobject ("ADODB.recordset") dim sqlStatment sqlStatment = sqlStatment + "SELECT MAX (Area_Code) AS AreaC FROM [Areas]" objRs2.OPEN sqlStatment,objConn,1,3 '========================================================================================= end sub
VIEWS ON THIS POST

84

Posted on:

Thursday 18th October 2012
View Replies!

Is there a maximum size of a recordset?

Hi! I have a database with a lot of chemical data. My ASP page allows the user to search out all data from a specific location during a specific time period. It then creates a normal html table with the results. The problem is when I have a large time period and a lot of parameters. For example: data from location 1, 1959 to 2005 returns a HTTP 500 error. When using "on error resume" only the code and data from the last three years are printed (all html tags etc missing from the beginning of the page). When I choose the period 1959-2002 it works, and also if I use 1970-2005 (which shows that it's not corrupt data in the 2003 year). My question is: is there a size limit for a recordset If so, how do I solve this If not, what could be my problem Size limit of html pages
VIEWS ON THIS POST

160

Posted on:

Thursday 18th October 2012
View Replies!

Primary key - maximum number of fields

Hi . I have a simple question which I can't really find the answer to. I'm studying for an exam, and one of the sample questions are "what is the maximum number of fields that can form part of the primary key in a MS Access database" The options are (a) 1 (b) 2 (c) 3 or (d) none of the above. I am thinking that is is not unlimited, but certainly greater than 3.
VIEWS ON THIS POST

256

Posted on:

Monday 22nd October 2012
View Replies!

Getting max value

I am trying to get he max value from a table that I will be updating in a form... I am using this max value as the unique identifer. I was doing this in Access 2003 but now in Access 2007...its not working... I am trying these two ways...maybe someone can shed some light on this\t\t The table is a LINKED SQL Table in SQL Server Hope someone can help here... THAnks EXAMPLE 1 In this example. Complaint Field Name dbo_Complaints_Table Linked SQL table name Complaint is the Textbox name in the form ERROR: Run time error '6' OVERFLOW Code: 'populate ID box with largest value + 1 Dim varID As Integer varID = Val(DMax("Complaint", "dbo_Complaints_Table")) + 1 Complaint = varID Me.Refresh EXAMPLE 2 I am getting errors on the ADODB Dim statement Code: Dim rs As ADODB.Recordset, MyVal As Currency Set rs = New ADODB.Recordset Open a Connection to the Recordset rs.Open "SELECT MAX(Complaint) from dbo_Complaints_Table", CurrentProject.Connection rs.MoveFirst MyVal = rs.Fields(0).Value Me.Text1.Value = Format(MyVal, "#,##0.00") MsgBox MyVal rs.Close Set rs = Nothing
VIEWS ON THIS POST

166

Posted on:

Monday 22nd October 2012
View Replies!