Results 1 to 2 of 2

Thread: {Resolved} A CASE statement looking for NULL

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2004
    Posts
    369

    {Resolved} A CASE statement looking for NULL

    Hi,

    I try to do this:

    Code:
    		CASE HAE1.idStatutEmploi
    			WHEN NULL THEN 'Employeur'
    			ELSE 'Profil emploi' 
    		END AS TypeAdresse,

    It never set the field TypeAdresse to "Employeur", but it should, I have many HAE1.idStatutEmploi set at NULL in my database.

    I guess my code is just not efficient.




    EDIT:
    OK .. found it.

    Code:
    		CASE 
    			WHEN HAE1.idStatutEmploi IS NULL THEN 'Employeur'
    			ELSE 'Profil emploi' 
    		END AS TypeAdresse,
    Last edited by dbelley_office; May 12th, 2006 at 10:00 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width