Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Recordset query

Enthusiast ,
Mar 09, 2009 Mar 09, 2009

Copy link to clipboard

Copied

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.
TOPICS
Server side applications

Views

555
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Mar 09, 2009 Mar 09, 2009
Thanks David - I hate when I forget 101 stuff!

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

Votes

Translate
LEGEND ,
Mar 09, 2009 Mar 09, 2009

Copy link to clipboard

Copied


"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


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 09, 2009 Mar 09, 2009

Copy link to clipboard

Copied

Good spot! They are NULL.... but :

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

Isn't returning any results either...

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 09, 2009 Mar 09, 2009

Copy link to clipboard

Copied

Good spot! They are NULL.... but :

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

Isn't returning any results either...

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 09, 2009 Mar 09, 2009

Copy link to clipboard

Copied

Good spot! They are NULL.... but :

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

Isn't returning any results either...

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 09, 2009 Mar 09, 2009

Copy link to clipboard

Copied

Iain71 wrote:
> SELECT * FROM Candidates WHERE Email = NULL ORDER BY CandidateID DESC

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

--
David Powers
Adobe Community Expert, Dreamweaver
http://foundationphp.com

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 09, 2009 Mar 09, 2009

Copy link to clipboard

Copied

LATEST
Thanks David - I hate when I forget 101 stuff!

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 09, 2009 Mar 09, 2009

Copy link to clipboard

Copied

OK - I don't know what happened there!

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines