473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Grabbing the maximum value of a field's contents (but not in an Sql statement)

I need to evaluate a field's maximum value and then do an if
conditional:
if rs("havesubP") = true and rs("displaygroup") < MAX then ....

whereas MAX represents the biggest value in the records for the
displaygroup field (an integer datatype). I get an "Either BOF or EOF
is True, or the current record has been deleted.." error if i put any
type of comparison number (of course MAX is not a vbscript keyword)
that is larger than my largest displaygroup value in the dbase , as I
will loop thru all the records once this condition is met.

thanks
chum
Jul 19 '05 #1
3 2881
Toss the recordset into an array. You can loop through it as many times as
you like then.

- Wm

--
William Morris
Product Development, Seritas LLC
Kansas City, Missouri

"Chumley the Walrus" <sp*******@yahoo.com> wrote in message
news:1e**************************@posting.google.c om...
I need to evaluate a field's maximum value and then do an if
conditional:
if rs("havesubP") = true and rs("displaygroup") < MAX then ....

whereas MAX represents the biggest value in the records for the
displaygroup field (an integer datatype). I get an "Either BOF or EOF
is True, or the current record has been deleted.." error if i put any
type of comparison number (of course MAX is not a vbscript keyword)
that is larger than my largest displaygroup value in the dbase , as I
will loop thru all the records once this condition is met.

thanks
chum

Jul 19 '05 #2
You need to check for eof in your loop. show the loop code.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Chumley the Walrus" <sp*******@yahoo.com> wrote in message
news:1e**************************@posting.google.c om...
I need to evaluate a field's maximum value and then do an if
conditional:
if rs("havesubP") = true and rs("displaygroup") < MAX then ....

whereas MAX represents the biggest value in the records for the
displaygroup field (an integer datatype). I get an "Either BOF or EOF
is True, or the current record has been deleted.." error if i put any
type of comparison number (of course MAX is not a vbscript keyword)
that is larger than my largest displaygroup value in the dbase , as I
will loop thru all the records once this condition is met.

thanks
chum

Jul 19 '05 #3
pobjRS.Sort = "[FIELD] DESC"
pdblMaxValue = pobjRS.Fields("FIELD").Value
pobjRS.Sort = vbNullString

Chris.
"Chumley the Walrus" <sp*******@yahoo.com> wrote in message
news:1e**************************@posting.google.c om...
I need to evaluate a field's maximum value and then do an if
conditional:
if rs("havesubP") = true and rs("displaygroup") < MAX then ....

whereas MAX represents the biggest value in the records for the
displaygroup field (an integer datatype). I get an "Either BOF or EOF
is True, or the current record has been deleted.." error if i put any
type of comparison number (of course MAX is not a vbscript keyword)
that is larger than my largest displaygroup value in the dbase , as I
will loop thru all the records once this condition is met.

thanks
chum
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: mr_burns | last post by:
hi, how do i do a SELECT statment that will just query a table to find the row with the maximum of a declared field. for example, if i have a table of customers and i would like to get the value...
20
by: | last post by:
If I need to check if a certain value does exist in a field, and return either "yes" or "not" which query would be the most effestive?
0
by: Matt | last post by:
I am running CR 8.5 from a (large) SQL Server db. My aim is to use crystal enterprise so end users in our sales team can access reports on demand for a given date range and client so I am trying...
9
by: ckerns | last post by:
I want to loop thru an array of controls,(39 of them...defaults = 0). If value is null or non-numeric I want to assign the value of "0". rowString = "L411" //conrol name if (isNaN(eval...
2
by: Kums | last post by:
What is the maximum permissible size of a database? Is there any limitation. What is the maximum # of tablespace's allowed in a database? Thanks for your response.
12
by: dixie | last post by:
Is there a maximum length in VBA of a line containing stuff like the following: If password = "1234" or password = "1235" or password = ............... Then It seems to me that at some stage, I...
1
by: K. Davis | last post by:
I need to increment the maximum value of a field of a table by 1 when a form opens a blank record. (e.g. =max(!![trip_number}) so the logic and references are working at the form level. I've...
3
by: Bengt Richter | last post by:
Has anyone found a way besides not deriving from dict? Shouldn't there be a way? TIA (need this for what I hope is an improvement on the Larosa/Foord OrderedDict ;-) I guess I can just document...
29
by: Amer Neely | last post by:
I've got a dynamically built form with checkboxes for each element ( a list of file names in a directory). I need to grab only those checkboxes that are checked, so I can then delete those files. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.