[AccessD] highest value of 4 variables - urgent

Andy Lacey andy at minstersystems.co.uk
Sun Nov 4 02:04:30 CST 2007


If you write yourself a general purpose Max function along the lines of

Function Max(var1, var2)

If var1>var2 then
  Max=var1
Else
  Max=var2
End if
End Function

then you can just

Result=Max(Max(Max(var4,var3),var2),var1)

-- Andy Lacey
http://www.minstersystems.co.uk 

> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com 
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of 
> Kath Pelletti
> Sent: 04 November 2007 00:15
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] highest value of 4 variables - urgent
> 
> 
> I would have thought so?
> 
> ----- Original Message ----- 
> From: "Rocky Smolin at Beach Access Software" <rockysmolin at bchacc.com>
> To: "'Access Developers discussion and problem solving'" 
> <accessd at databaseadvisors.com>
> Sent: Sunday, November 04, 2007 11:12 AM
> Subject: Re: [AccessD] highest value of 4 variables - urgent
> 
> 
> > Yeah, there must be something like Max(var1, var2, var3, var4)
> >
> > Rocky
> >
> >
> >
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: accessd-bounces at databaseadvisors.com
> > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kath 
> > Pelletti
> > Sent: Saturday, November 03, 2007 4:36 PM
> > To: Access Developers discussion and problem solving
> > Subject: Re: [AccessD] highest value of 4 variables - urgent
> >
> > That's where I am with it too Rocky - until I get another 
> solution I 
> > will
> > go
> > with this.....(but I'm sure there will be something that we 
> both can't
> > remember?)
> >
> > Ta
> > ----- Original Message -----
> > From: "Rocky Smolin at Beach Access Software" 
> <rockysmolin at bchacc.com>
> > To: "'Access Developers discussion and problem solving'" 
> > <accessd at databaseadvisors.com>
> > Sent: Sunday, November 04, 2007 10:29 AM
> > Subject: Re: [AccessD] highest value of 4 variables - urgent
> >
> >
> >> Brute Force?
> >>
> >> Function GetHigh as Variant
> >>
> >> GetHigh = var1
> >> If var2 > GetHigh Then GetHigh = var2
> >> If var3 > GetHigh Then GetHigh = var3
> >> If var4 > GetHigh Then GetHigh = var4
> >>
> >> End Function
> >>
> >> I'm sure there's a more elegant way...
> >>
> >> Rocky
> >>
> >>
> >>
> >>
> >>
> >> -----Original Message-----
> >> From: accessd-bounces at databaseadvisors.com
> >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kath 
> >> Pelletti
> >> Sent: Saturday, November 03, 2007 3:57 PM
> >> To: Access D Normal List
> >> Subject: [AccessD] highest value of 4 variables - urgent
> >>
> >> maybe i am having a vague moment - but what function can I 
> use to get 
> >> the highest value of 4 variables, eg:
> >>
> >>
> >> eg. I want to know x where x is the highest of (var1, var2, var3, 
> >> var4)
> >>
> >> ta
> >> ______________________________________
> >> Kath Pelletti
> >> --
> >> AccessD mailing list
> >> AccessD at databaseadvisors.com 
> >> http://databaseadvisors.com/mailman/listinfo/accessd
> >> Website: http://www.databaseadvisors.com
> >>
> >> No virus found in this incoming message.
> >> Checked by AVG Free Edition.
> >> Version: 7.5.503 / Virus Database: 269.15.19/1106 - Release Date: 
> >> 11/2/2007 9:46 PM
> >>
> >>
> >> --
> >> AccessD mailing list
> >> AccessD at databaseadvisors.com
> >> http://databaseadvisors.com/mailman/listinfo/accessd
> >> Website: http://www.databaseadvisors.com
> >>
> >
> >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.503 / Virus Database: 269.15.19/1106 - Release Date:
> > 11/2/2007
> > 9:46 PM
> >
> >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> > 
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> 





More information about the AccessD mailing list