[V4RB] SQL again ... arrrgh!

Pedro fp lists at pedro.Net.au
Wed Oct 27 02:04:24 CDT 2004


G'day Folks

I'm trying to construct a set of canned searched in my current project 
& while most are working fine I'm stumbling on one pair. They are to 
find records where one VString field is empty and not empty 
respectively. As a precaution I've tried to construct my searches to 
cover both possibilities, that an empty field is an empty string and 
that an empty field is null.

The SQL strings I've tried so far are (in pairs for the empty field 
then the not empty field)  ...

SELECT ... WHERE ( NOT extention LIKE '' and NOT extention = NULL ) 
ORDER BY name ASC
SELECT ... WHERE ( extention LIKE '' or extention = NULL ) ORDER BY 
name ASC

SELECT ... WHERE ( NOT extention = '' and NOT extention = NULL ) ORDER 
BY name ASC
SELECT ... WHERE ( extention = '' or extention = NULL ) ORDER BY name 
ASC

SELECT ... WHERE ( NOT extention = '' and NOT extention IS null ) ORDER 
BY name ASC
SELECT ... WHERE ( extention = '' or extention IS null ) ORDER BY name 
ASC

SELECT ... WHERE NOT ( extention = '' or extention IS null ) ORDER BY 
name ASC
SELECT ... WHERE ( extention = '' or extention IS null ) ORDER BY name 
ASC

Any tips on where I'm going wrong? If possible I'd prefer to negate 
outside the parentheses as in my last attempt but it's not a big issue 
if that's not possible.

Cheers, Pedro :-)

Web: <http://www.pedro.net.au>                    PGP Key ID: 387CD96F
Instant messaging...  AIM: bandidoOfOz  ICQ: 27671678  Jabber: pedrofp
                       MSN: mail at pedro.net.au           Yahoo: pedro_fp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"How would we think if we saw the twenty-first century as
'The Healing Century' and left the economic emphasis behind
in the twentieth?"
                                       Robert Theobald, 1998



More information about the Valentina mailing list