472,133 Members | 1,058 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,133 software developers and data experts.

Stored Proc help

Hi..

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
1 1003
ck9663
2,878 Expert 2GB
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.

Similar topics

4 posts views Thread by Nyul | last post: by
6 posts views Thread by Paul M | last post: by
2 posts views Thread by =?Utf-8?B?Vmlua2k=?= | last post: by
1 post views Thread by =?Utf-8?B?Vmlua2k=?= | last post: by
2 posts views Thread by Rob Eventine | last post: by
reply views Thread by mirandacascade | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.