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[code=sql]
@MemberID uniqueidentifier,
@DateFrom datetime,
@DateTo datetime,
@RepID uniqueidentifier,
@BrandID uniqueidentifier[/codel]
The statement is folows
Expand|Select|Wrap|Line Numbers
- WITH Images (Brand_Name,Brand_ID,Product_ID, ImagesCount) AS
- ( select distinct vb.brand_name,vb.Brand_ID,vb.product_id,count(vb.product_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
- )
How can i do that,
Pls help me to solve.....