Int() function has one undocumented feature - it can convert boolean (logical) statements into integer values (returns 1 of TRUE, 0 if FALSE). With use of it you can rewrite your code into something like this:

Update mytable set X = (Int(A<C) * B + Int(C<A) * D) * Int(Not(A=C))

Jaromir Svasta


On Thu, 30 Oct 2003 16:44:20 +0100, Uffe Kousgaard <[EMAIL PROTECTED]> wrote:


In one line:

update mytable set X = B*(minimum(A,C)-C)/(A-C)+D*(minimum(A,C)-A)/(C-A)

If A=C, the record will not be updated. That should also be like
requested, but you get a division by 0 error.

Kind regards

Uffe Kousgaard
www.routeware.dk

----- Original Message -----
From: "Lathrop, Travis C [PCS]" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 30, 2003 4:06 PM
Subject: MI-L Update Column Help


I want to update column x with either column B or D. I want MapInfo to compare column A and column C to decide whether to populate x with B or D. Basically something to the effect of:

Update X with B if A<C or Update X with D if C<A.......

Can someone please tell me if I am missing something?

Travis Lathrop
Intercarrier Services
913-762-8064



---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 8964




--------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 8999



Reply via email to