By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,773 Members | 2,307 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,773 IT Pros & Developers. It's quick & easy.

not null

P: n/a
Hi,

When are string fields null, and when are they empty?
For example, if the record has never been edited, is it null?
If the record has been edited but deleted, is it an empty string?

I'm not sure whether to use:

x is not null
or
x <> ""
Thanks,
Chris
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"C L Humphreys" <cl*********@toofgib.moc> wrote in message
news:bl**********@ucsnew1.ncl.ac.uk...
Hi,

When are string fields null, and when are they empty?
For example, if the record has never been edited, is it null?
If the record has been edited but deleted, is it an empty string?

I'm not sure whether to use:

x is not null
or
x <> ""


First off you should check the field description in the table's design view to see if
the field even allows zero-length-strings (the default is no). If it doesn't then
you never have to worry about checking for anything but Null. If it does allow them
then you pretty much have to test for both. I usually use one of the following...

If Len(Nz([FieldName],"")) = 0 Then...
or
If Len([FieldName] & "") = 0 Then...
Nov 12 '05 #2

P: n/a
"Rick Brandt" <RB*****@Hunter.Com> wrote in message
news:bl************@ID-98015.news.uni-berlin.de...
"C L Humphreys" <cl*********@toofgib.moc> wrote in message
news:bl**********@ucsnew1.ncl.ac.uk...
I'm not sure whether to use:

x is not null
or
x <> ""
First off you should check the field description in the table's design

view to see if the field even allows zero-length-strings (the default is no). If it doesn't then you never have to worry about checking for anything but Null. If it does allow them then you pretty much have to test for both.


Great, that helps a lot!

Chris
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.