PC Review


Reply
Thread Tools Rate Thread

Calculating a value of a field with iif rule in report

 
 
Svetac
Guest
Posts: n/a
 
      13th Mar 2011
Hi folks,
I've created a report that has text field A which is a sum of other
fields and it changes depending on ProductID.
I have a text field B that should have value depending on value of
text field A as follows:
If A is < 3000 then B = 80
If A is between 3000 and 6000 then B = 160
If A is between 6000 and 9000 then B = 250
If A is between 9000 and 12000 then B = 330
If A is between 12000 and 15000 then B = 400
If A is > 15000 then B = 500+X where X=(A-15000)*0,01 but if the
result of "(A-15000)*0,01" is >5000 then X=5000.

Can this be done with iif rule in Expression Builder? Or I need a
function?
Any help would be appreciated.
JJ
 
Reply With Quote
 
 
 
 
XPS350
Guest
Posts: n/a
 
      14th Mar 2011
On 13 mrt, 20:57, Svetac <svetac.thesa...@gmail.com> wrote:
> Hi folks,
> I've created a report that has text field A which is a sum of other
> fields and it changes depending on ProductID.
> I have a text field B that should have value depending on value of
> text field A as follows:
> If A is *< 3000 then B = 80
> If A is *between 3000 and *6000 then B = 160
> If A is *between 6000 and 9000 then B = 250
> If A is *between 9000 and 12000 then B = 330
> If A is *between 12000 and 15000 then B = 400
> If A is *> 15000 then B = 500+X where X=(A-15000)*0,01 but if the
> result of "(A-15000)*0,01" is >5000 then X=5000.
>
> Can this be done with iif rule in Expression Builder? Or I need a
> function?
> Any help would be appreciated.
> JJ


It can be done in both ways.

I think a function is the best way.
The IIF will have a lot of nesting levels which makes it hard to
write. In a function you can use the Select Case instruction. That
helps you to get a clear view, no matter the number of levels.

Groeten,

Peter
http://access.xps350.com
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation Rule and Calculating Average HELP Kristin Microsoft Access Forms 2 20th Jun 2008 09:48 PM
Validation Rule? IF (Field A) = (Cell Value), then Field B ok =?Utf-8?B?VC5LYXk=?= Microsoft Access Database Table Design 2 31st May 2007 08:57 PM
Calculating Average for a field which is calculated field itself Moor Microsoft Access Form Coding 2 30th Sep 2006 02:48 PM
basing a field validation rule on another field in same table... Brad Pears Microsoft Access Database Table Design 2 5th Apr 2006 12:12 AM
Pivot table, calculating a new field derived from other field, e.g =?Utf-8?B?TWFkaXNvbg==?= Microsoft Excel Misc 1 5th Nov 2004 01:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:57 AM.