CASE statement error

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
Hart_Runge_(Guest)
Posts: 5
Joined: Tue Oct 10, 2017 12:44 pm

CASE statement error

Post by Hart_Runge_(Guest) » Sun Apr 10, 2005 1:13 am

The following is recent discovery with R&R 10+ using CASE statement.____Fields FROM and TO are from a single record DBF file linked with record 1 in xBase version.____ISBLANK( FROM ) <- returns TRUE__ISBLANK( TO ) <- returns TRUE____CASE( TRUE, ISBLANK( FROM ),1, ISBLANK( TO ), 2, 3 ) <- returns 2__CASE( TRUE, ISBLANK( TO ),1, ISBLANK( FROM ), 2, 3 ) <- Also returns 2____Ke?____hartrung@3logix.com.au____If you hav any fixes or advice please let me know.

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: CASE statement error

Post by kfleming » Mon Apr 11, 2005 7:22 am

Typically a case statement contains a list of mutually exclusive values. In your expression there is more that one member that returns the same value. So R&R is returning the last value in the list that meets the condition rather than the first value in the list.__For example the expression:__CASE(1,1,1,1,2,3)__returns a 2____and __CASE(1,1,1,1,2,1,3,4)__returns a 3____I checked the doc for the function and it does not specifically document how duplicates are handled.____Kathleen__R&R Support__

Post Reply