Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 COALESCE Problem

Author  Topic 

sp_wiz
Yak Posting Veteran

55 Posts

Posted - 2001-11-12 : 09:01:02
Why does this part of an sql statement work fine but stick it in part of an exec statement and it will not work at all. Returns nothing


WHERE
Photos.sub_code IN (Select Subject.sub_code from subject where Subject.text1 = COALESCE( @photocategory ,subject.text1)) AND
Photos.Sub_code = COALESCE( @photosubcategory ,photos.Sub_code) AND
Photos.PH_code = COALESCE( @Photographer , Photos.PH_code) AND
Photos.Web_Update > getdate() - @datesubmitted
ORDER BY Photos.Web_Update

robp

   

- Advertisement -