PC Review


Reply
Thread Tools Rate Thread

Creating a value from two values

 
 
=?Utf-8?B?bWNjbG91ZA==?=
Guest
Posts: n/a
 
      3rd Mar 2006
Table:IMINVLOC contains the two values
Leadtime and Margin%

Leadtime - has one of 3 values. (7,14,21)
7=A, 14=B, 21=C
Margin% is the second field. Margin% ranges from 0% - 100%
Less than 7%=A
Less Than 12% but greater than 7%=B
Greater than 12%=C

I need to compare each value and assign a value. Example...(AA, AB, AC)

Here is an example...
Item:1234 has a lead time 7 and a margin% of 9%, so I want to assign a value
of "CB"

Whats the best way of comparing and assign this value.
Thanks




 
Reply With Quote
 
 
 
 
=?Utf-8?B?eFJvYWNoeA==?=
Guest
Posts: n/a
 
      3rd Mar 2006
Use a case statement to evaluate each numerical value to assign a letter
value based on the range. This equates to 3-4 case statements for each
evaluation depending on how you structure it.

Finally, concatenate the letter values.

"mccloud" wrote:

> Table:IMINVLOC contains the two values
> Leadtime and Margin%
>
> Leadtime - has one of 3 values. (7,14,21)
> 7=A, 14=B, 21=C
> Margin% is the second field. Margin% ranges from 0% - 100%
> Less than 7%=A
> Less Than 12% but greater than 7%=B
> Greater than 12%=C
>
> I need to compare each value and assign a value. Example...(AA, AB, AC)
>
> Here is an example...
> Item:1234 has a lead time 7 and a margin% of 9%, so I want to assign a value
> of "CB"
>
> Whats the best way of comparing and assign this value.
> Thanks
>
>
>
>

 
Reply With Quote
 
tina
Guest
Posts: n/a
 
      3rd Mar 2006
a couple of nested IIf() functions in a calculated field in a query should
do it, as

CalcCode: IIf(LeadTime = 7, "A", IIf(LeadTime = 14, "B", "C")) & IIf(Margin
<= .07, "A", IIf(Margin < .12, "B", "C"))

hth


"mccloud" <(E-Mail Removed)> wrote in message
news57FE475-A9B1-4484-8853-(E-Mail Removed)...
> Table:IMINVLOC contains the two values
> Leadtime and Margin%
>
> Leadtime - has one of 3 values. (7,14,21)
> 7=A, 14=B, 21=C
> Margin% is the second field. Margin% ranges from 0% - 100%
> Less than 7%=A
> Less Than 12% but greater than 7%=B
> Greater than 12%=C
>
> I need to compare each value and assign a value. Example...(AA, AB, AC)
>
> Here is an example...
> Item:1234 has a lead time 7 and a margin% of 9%, so I want to assign a

value
> of "CB"
>
> Whats the best way of comparing and assign this value.
> Thanks
>
>
>
>



 
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
XmlSerializer not creating attribute values John A Grandy Microsoft C# .NET 2 2nd Nov 2008 01:23 AM
Creating a list of cell values Link Microsoft Excel New Users 3 14th Feb 2008 09:32 AM
Creating a chart from a table of values =?Utf-8?B?aHlkcm8xZ3V5?= Microsoft Excel Charting 1 5th Apr 2006 06:42 PM
Creating array from listbox values =?Utf-8?B?UmVuw6k=?= Microsoft Access VBA Modules 1 23rd Feb 2006 02:44 PM
Creating a list of values JC Home Microsoft Excel Programming 1 2nd Jan 2006 10:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:50 PM.