Normal Topic /0 retrieving empty fields? (Read 905 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
/0 retrieving empty fields?
May 21st, 2007 at 6:42pm
Print Post Print Post  
Today, in preparation for bringing my live Q&A data into my Sesame databases, I tried some experiments.  I flushed all my test data out of the Customer database, exported my Q&A data to a standard comma-delimited text file, and imported it into Sesame.  I got no error messages, so it seems as if everything went fine.

Then I tried a retrieve, using /0 as my spec, in the "Discount" field (this is a number field).  Of 10075 customer records, only 9 have a value in that field; all the rest are blank.

But the retrieve returned all 10075 records.  I changed the spec to >0 and the 9 I wanted were returned.

I thought that was strange, that /0 would return records where the field was empty.  So I thought that maybe an invisible "space" was in there.  So I started over, and this time I did not export, nor did I import, the Discount field.  Yet again, /0 returned all records.

So I tested another database, my personnel database.  Some of the records have an amount in the Uniform field but most do not (this is a money field).  Again, /0 returned all records.

Not sure what's going on, but it's probably me misunderstanding something rather than an error with the program.
  

**
Captain Infinity
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: /0 retrieving empty fields?
Reply #1 - May 21st, 2007 at 7:10pm
Print Post Print Post  
In a search spec, an equal sign by itself (i.e.: "=") will return records with that element blank. Using a slash followed by an equal sign (i.e.: "/=") will return records with that element non-blank.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: /0 retrieving empty fields?
Reply #2 - May 21st, 2007 at 8:05pm
Print Post Print Post  
Thanks Mark, I understand that.  However, what I'm looking for are records where the specific element is not Zero.  I'm surprised that blanks meet that qualification.  My assumption is that, in a numerical or money field, a blank would be considered zero.  In Q&A, with the same database, a retrieve spec of /0 returns only the 9 records with an amount in them.  In Sesame, all records are returned, including all the blanks.  Like I said, I'm probably misunderstanding something.
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: /0 retrieving empty fields?
Reply #3 - May 21st, 2007 at 8:24pm
Print Post Print Post  
Infinity wrote on May 21st, 2007 at 8:05pm:
Thanks Mark, I understand that.  However, what I'm looking for are records where the specific element is not Zero.  I'm surprised that blanks meet that qualification.  My assumption is that, in a numerical or money field, a blank would be considered zero.


Blank and zero are not the same thing in a search.  Zero is a value that you filled in. Blank is the absence of a value.


Quote:
In Q&A, with the same database, a retrieve spec of /0 returns only the 9 records with an amount in them.  In Sesame, all records are returned, including all the blanks.  Like I said, I'm probably misunderstanding something.


Unfortunately, Q&A is not consistent about when it considers blank and zero to be the same. For example, if you search in your Q&A database for /0, you do not get the blanks. However, if you search the same field for 0, you also do not get the blanks. We did not want to reproduce this inconsistency in Sesame.

If you want records that are not 0 and are not blank, say so: /0;=
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged