Drew Sanderson Posted October 12, 2006 Posted October 12, 2006 (edited) I have set up a find using global fields. In the example below I would like to search the size of something. The calculation I used resulted in an error that says this number cannot be evaluated and I dont know why. Here is the case statement: Case ( (IsValid ( F_Size_Low ) and IsValid ( F_Size_High )) ; "(F_Size_Low) & "..." & (F_Size_High)"; (IsValid ( F_Size_Low ) and IsEmpty ( F_Size_High )) ; "(F_Size_Low) & "...50"; (IsEmpty ( F_Size_Low ) and IsValid ( F_Size_High )) ; ""0..." & (F_Size_High)" ) The first test says that if both are valid then search the range. The second say that if the low is valid and the high is not, search the range from the valid low to 50. The third says that if the high is valid and the low is not search the range from the high to zero. Where did I go wrong? Thanks, Drew Edited October 12, 2006 by Guest
Ender Posted October 12, 2006 Posted October 12, 2006 There are a couple problems I can see right off the bat. 1. Don't use IsValid() for this purpose, instead use 'not isempty()'. Second, your quotes aren't matched up correctly; in fact, quotes aren't needed around field names. Anyway, you can probably simplify the calc a bit: Case (not isempty ( F_Size_Low ); F_Size_Low; 0) & "..." & Case (not isempty( F_Size_High ); F_Size_High; 50)
Drew Sanderson Posted October 12, 2006 Author Posted October 12, 2006 Thanks for the reply. That worked great. I am just starting to get in to doing calucalations and appreciate the help. I thought you could do the "not isempty" but could not find it in the help file (which is suprisingly helpful). I want to make sure I understand the calculation correctly. Case (not IsEmpty ( F_Size_Low ); F_Size_Low; 0) says that if Low has somehting in it then use that value but if not then use 0. Case (not IsEmpty( F_Size_High ); F_Size_High; 50) says that if High has something in it use that value otherwise use 50 Is this correct? Thanks for your help Drew
Ender Posted October 12, 2006 Posted October 12, 2006 Ya sure. You could also write it like this: Case (isempty ( F_Size_Low ); 0; F_Size_Low) & "..." & Case (isempty( F_Size_High ); 50; F_Size_High)
Drew Sanderson Posted October 12, 2006 Author Posted October 12, 2006 Thanks for the reply... I was wondering why was the IsValid not an ok way to go?
Ender Posted October 12, 2006 Posted October 12, 2006 IsValid() is meant for checking the type-match of the data or that a relationship is intact, not for checking if a field contains information. You might check the function description in the application Help.
Recommended Posts
This topic is 6674 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now