Skip to main content
Inspiring
March 9, 2009
Answered

Recordset query

  • March 9, 2009
  • 2 replies
  • 721 views
This must be an easy one, and I know I'll kick myself, but its been a long day!

I'm basically just trying to filter out a table of contacts into two pages - one listing contacts that do have an email address, and one listing contacts that don't have an email address.

For the ones that do have an email address, I've used :

SELECT * FROM Candidates WHERE Email <> '' ORDER BY CandidateID DESC

Which works fine.

So I would have thought that :

SELECT * FROM Candidates WHERE Email = '' ORDER BY CandidateID DESC

would show all the candidates that didn't have an email address.

Can anyone put me out of my misery and remind what I do need to list contacts where the Email field is empty?

Thanks.

would show the ones that didn't have a email address.
This topic has been closed for replies.
Correct answer johngordon12
Thanks David - I hate when I forget 101 stuff!

I have just noticed something weird though - started a new thread...

2 replies

Inspiring
March 9, 2009
OK - I don't know what happened there!
Inspiring
March 9, 2009

"Iain71" <webforumsuser@macromedia.com> wrote in message
news:gp3tb1$j65$1@forums.macromedia.com...
> This must be an easy one, and I know I'll kick myself, but its been a long
> day!
>
> I'm basically just trying to filter out a table of contacts into two
> pages -
> one listing contacts that do have an email address, and one listing
> contacts
> that don't have an email address.
>
> For the ones that do have an email address, I've used :
>
> SELECT * FROM Candidates WHERE Email <> '' ORDER BY CandidateID DESC
>
> Which works fine.
>
> So I would have thought that :
>
> SELECT * FROM Candidates WHERE Email = '' ORDER BY CandidateID DESC
>
> would show all the candidates that didn't have an email address.

is that field "blank" or is it actually "null"? try replacing the '' with
the word (no quotes) NULL


Inspiring
March 9, 2009
Good spot! They are NULL.... but :

SELECT * FROM Candidates WHERE Email = NULL ORDER BY CandidateID DESC

Isn't returning any results either...