Razzak, Thank you for the explanation. It makes perfect sense. Truly, making mistakes is how we learn! <g>
-----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of A. Razzak Memon Sent: Tuesday, December 28, 2004 8:34 AM To: RBG7-L Mailing List Subject: [RBG7-L] - Re: Form Expression At 08:10 AM 12/28/2004 -0600, Claudine Robbins wrote: >Razzak, > >Thank you for your help! > >The following works: >rate IN d_rates WHERE client = .vclient AND carrier = 99 AND truck_type = >.vtrucktype AND (category BETWEEN .vadjmileage AND (.vadjmileage + 10)) > >FYI, before I corrected a couple of mismatched variable types and added all >the parens, the error message was Nulls cannot be used in comparisons... > >Now I can go forward... Thanks again for helping me see the error of my >ways! Claudine, Here's the technical explanation of that -ERROR- message when comparing NULL values: When comparing text columns to text variables you can actually get away with "column = .var" when EQNULL is ON, but when using non-text columns like INTEGERs, R:BASE is not as forgiving. If you are specifically looking for NULL values you should use a where clause with "column IS NULL". If you are using an INTEGER variable which might be NULL, then you need to put parentheses around the variable like "column = (.var)". This forces R:BASE to compare the column to the variable itself, rather than trying to compare the column to the value derived when the variable is converted to a text string. When the NULL display is blank, this derived value looks like nothing. Hope that helps you understand the logic of using parenthesis when comparing NULL values. Very Best R:egards, Razzak.
