JackM wrote:The fields probably do contain information - like an empty string. But> I have a table with a dozen or so fields. I am trying to return all 12
> fields in all records that contain an entry in the field named 'week'.
> This select does that:
> "SELECT * FROM foo WHERE NOT ISNULL(week) ORDER BY week DESC";
> but it also includes all other records that do not have an entry in the
> week field after the DESC ones have been listed. How can I modify the
> query to only return the ones that have an entry in week and none of the
> other ones? I thought NOT ISNULL would take care of it but it doesn't.
not knowing how week is defined, it's hard to say what might be in there.
Remember - an empty string is a value, whereas NULL is specifically the
lack of a value.
If this is a varchar field, you can check with something like:
"SELECT * FROM foo WHERE NOT ISNULL(week) AND week<>'' ORDER BY week DESC.
Or you can correct your database to replace the empty strings with nulls.
Remove the "x" from my email address
JDS Computer Training Corp.