By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,379 Members | 1,377 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,379 IT Pros & Developers. It's quick & easy.

Stored Proc help

P: 36

I have a select statement inside(WITH statement), In the where clause of the where statement we are checking withe passed argument. The belows are the passed argument
@MemberID uniqueidentifier,
@DateFrom datetime,
@DateTo datetime,
@RepID uniqueidentifier,
@BrandID uniqueidentifier

The statement is folows

WITH Images (Brand_Name,Brand_ID,Product_ID, ImagesCount) AS

select distinct vb.brand_name,vb.Brand_ID,vb.product_id,count(vb.p roduct_id) as ImagesCount from dbo.vSalesMgr_ImageVisibility vb
join tblrl_brands b on vb.brand_id = b.brand_id
where brand_owner = @MemberID and vb.AI_Date between @datefrom and @dateto and vb.Brand_ID = @BrandID
group by vb.brand_id, vb.brand_name,vb.product_id

Some times the may null, at that time i need not check with the Brand_ID, If it contains value(Vive versa).
How can i do that,

Pls help me to solve.....
Apr 11 '08 #1
Share this Question
Share on Google+
1 Reply

Expert 2.5K+
P: 2,878
Use the ISNULL() function or use CASE

-- CK
Apr 12 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.