Results 1 to 2 of 2

Thread: {Resolved} A CASE statement looking for NULL

  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.

  2. #2
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: A CASE statement looking for NULL

    Id this in a vb proc or in an SQL statement?

    If it is in an SQL statement it should be

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

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

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