Re: Multiple calculations on same field in Query, by range of valu
- From: "Pat Hartman" <patsky@xxxxxxxxxxxxx>
- Date: Fri, 1 Apr 2005 16:19:38 -0500
Stay with the original thread. If you haven't gone too far with your db,
you might consider turning on the Name Auto Correct features and getting rid
of those pesky spaces.
"Gregrenae" <Gregrenae@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1AAE2FCB-B7E3-404A-8D08-805B09F654F0@xxxxxxxxxxxxxxxx
> My apologies, "Post the original SQL". Do you mean to copy the info as I
> have done below or start a new thread or?
> Thanks Again
>
> Original Post:
> OK, I am new to Access, have studied hard and long, but apparently am
short
> on the long. Trying to write the following Query:
> Field One contains a numberic value(ie: 115 or 219 or 320)
> I create the following Calculated Field:
> Field Two:[Field One]
> Now I want to perform the following calculation:
> If >=1 AND <=100 put in $300.00
> If >=101 AND <=200 put in $400.00
> If >=201 AND <=300 put in $500.00
>
> What shoud the rest of the formula be?
> Field Two:[Field One]
>
> Formulas Tried (I am putting this into the second column of the Query
table,
> in the "Field")
> Amount we are Invoicing [SF of Blue Tarp Installed]: IIf (SF of Blue Tarp
> Installed >=1 and SF of Blue Tarp Installed <101, 300, IIF(SF of Blue Tarp
> Installed >=101 and SF of Blue Tarp Installed <201, 400, IIf(SF of Blue
Tarp
> Installed >= 201 and SF of Blue Tarp Installed <= 300, 500, 999)))
> [Amount we are Invoicing [SF of Blue Tarp Installed]]: IIf ([SF of
> Blue Tarp Installed] >=1 and [SF of Blue Tarp Installed] <101, 300,
> IIF([SF of Blue Tarp Installed] >=101 and [SF of Blue Tarp Installed]
> <201, 400, IIf([SF of Blue Tarp Installed] >= 201 and [SF of Blue Tarp
> Installed] <= 300, 500, 999)))
>
>
> "John Vinson" wrote:
>
> > On Fri, 1 Apr 2005 06:43:05 -0800, Gregrenae
> > <Gregrenae@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > >John,
> > >Thanks for your time and consideration. However, I am still running
into a
> > >problem. When I put the formula in, I get the following error message,
> > >"[Amount we are invoicing [SF of Blue Tarp Installed]] is not a valid
name.
> > >Make sure it does not include invalid characters or punctuation that is
too
> > >long".
> > >When I use the exact same name and just do a simple calculation, ie:
*10, it
> > >works fine. All the same I changed the field name all the way down to
> > >"Tarp", still without success. I sure would like to know how to make
this
> > >work without having to creat another table. Do you have any
suggestions?
> > >Thanks
> >
> > Please post the actual SQL again.
> >
> > John W. Vinson[MVP]
> >
.
- References:
- Multiple calculations on same field in Query, by range of values
- From: Gregrenae
- RE: Multiple calculations on same field in Query, by range of values
- From: Gregrenae
- Re: Multiple calculations on same field in Query, by range of values
- From: John Vinson
- Re: Multiple calculations on same field in Query, by range of valu
- From: Gregrenae
- Multiple calculations on same field in Query, by range of values
- Prev by Date: Re: problem with query in vba
- Next by Date: Re: pass through query for ODBC links
- Previous by thread: Re: Multiple calculations on same field in Query, by range of valu
- Next by thread: how to count records in a query
- Index(es):
Relevant Pages
|