Group:  Microsoft Access ยป microsoft.public.access.gettingstarted
Thread: If then Statements

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

If then Statements
jasonn 18.07.2006 10:57:01
Can someone please help me

I have a query with the following fields
Min Weight, Actual Weight, Vol. Weight

I need to workout what the Excess Weight is depending on which is
greaterbetween Actual Weight and Vol. Weight

Something like this:
If Actual Weight > Vol. Weight Then
Excess Weight = Actual Weight - Min. Weight
Else
Excess Weight = Vol. Weight - Min. Weight
End If.

How do i do this in the query?
Re: If then Statements
"BruceM" <bamoob[ at ]yawwhodawtcalm.not> 18.07.2006 11:17:06
At the top of a blank column in the query design grid, try the IIf function:

ExcessWeight: IIf([Actual Weight] > [Vol. Weight],[Actual Weight] - [Min.
Weight],[Vol. Weight] - [Min. Weight])

Base your form or report on the query, and use ExcessWeight as the Control
Source of a text box.

"jasonn" <jasonn[ at ]discussions.microsoft.com> wrote in message
news:44087263-4E27-46F7-9DDE-663A82248E0E[ at ]microsoft.com...
[Quoted Text]
> Can someone please help me
>
> I have a query with the following fields
> Min Weight, Actual Weight, Vol. Weight
>
> I need to workout what the Excess Weight is depending on which is
> greaterbetween Actual Weight and Vol. Weight
>
> Something like this:
> If Actual Weight > Vol. Weight Then
> Excess Weight = Actual Weight - Min. Weight
> Else
> Excess Weight = Vol. Weight - Min. Weight
> End If.
>
> How do i do this in the query?


Re: If then Statements
jasonn 18.07.2006 16:27:02
Thank you so much Bruce, your help is much appreciated

"BruceM" wrote:

[Quoted Text]
> At the top of a blank column in the query design grid, try the IIf function:
>
> ExcessWeight: IIf([Actual Weight] > [Vol. Weight],[Actual Weight] - [Min.
> Weight],[Vol. Weight] - [Min. Weight])
>
> Base your form or report on the query, and use ExcessWeight as the Control
> Source of a text box.
>
> "jasonn" <jasonn[ at ]discussions.microsoft.com> wrote in message
> news:44087263-4E27-46F7-9DDE-663A82248E0E[ at ]microsoft.com...
> > Can someone please help me
> >
> > I have a query with the following fields
> > Min Weight, Actual Weight, Vol. Weight
> >
> > I need to workout what the Excess Weight is depending on which is
> > greaterbetween Actual Weight and Vol. Weight
> >
> > Something like this:
> > If Actual Weight > Vol. Weight Then
> > Excess Weight = Actual Weight - Min. Weight
> > Else
> > Excess Weight = Vol. Weight - Min. Weight
> > End If.
> >
> > How do i do this in the query?
>
>
>
Re: If then Statements
"BruceM" <bamoob[ at ]yawwhodawtcalm.not> 18.07.2006 16:48:09
You're welcome. Glad it helped.

"jasonn" <jasonn[ at ]discussions.microsoft.com> wrote in message
news:8568DAED-CF03-4CF8-8FA0-9DE0BD136DD0[ at ]microsoft.com...
[Quoted Text]
> Thank you so much Bruce, your help is much appreciated
>
> "BruceM" wrote:
>
>> At the top of a blank column in the query design grid, try the IIf
>> function:
>>
>> ExcessWeight: IIf([Actual Weight] > [Vol. Weight],[Actual Weight] -
>> [Min.
>> Weight],[Vol. Weight] - [Min. Weight])
>>
>> Base your form or report on the query, and use ExcessWeight as the
>> Control
>> Source of a text box.
>>
>> "jasonn" <jasonn[ at ]discussions.microsoft.com> wrote in message
>> news:44087263-4E27-46F7-9DDE-663A82248E0E[ at ]microsoft.com...
>> > Can someone please help me
>> >
>> > I have a query with the following fields
>> > Min Weight, Actual Weight, Vol. Weight
>> >
>> > I need to workout what the Excess Weight is depending on which is
>> > greaterbetween Actual Weight and Vol. Weight
>> >
>> > Something like this:
>> > If Actual Weight > Vol. Weight Then
>> > Excess Weight = Actual Weight - Min. Weight
>> > Else
>> > Excess Weight = Vol. Weight - Min. Weight
>> > End If.
>> >
>> > How do i do this in the query?
>>
>>
>>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net