开发者

Issue with No Activity in PDF File

开发者 https://www.devze.com 2023-04-11 17:52 出处:网络
I am having below a sql code that dispalys NO ACTIVITY (for the feild AFFILIATE) IF @affiliate <> \'ALL\'

I am having below a sql code that dispalys NO ACTIVITY (for the feild AFFILIATE)

IF @affiliate <> 'ALL'
BEGIN
    INSERT INTO #NoActivity
    SELECT  bankFusiCode, 'N' 
    FROM frmmaster
    WHERE oldfirmcode = @affiliate
END
ELSE
BEGIN
    INSERT INTO #NoActivity开发者_运维问答
    SELECT a.bankFusiCode, 'N' 
    FROM frmmaster a, tblfrmlstdropdown b
    WHERE a.oldfirmcode = b.oldfirmcode
    AND b.reportnumber = '22046' 
    AND bankFusiCode IS NOT NULL
END

In the same way,I want a code for one of the parameter in my procedure @superproducttype we need to display each Super Product Type (selected) to the report for which data is blank.

So my PDF file is looks like this:

-------------------------------------------------------------------------------------
custname  price  trade   sales    person
-----------------------------------------------
super product type
------------------------------------------
           n0 activity for date range

Super product type is showing empty in the PDF file. If there is no data, to display the name of super product type.


If I understand your question correctly then it seems like you need to use an outer join to join to the Super Product Type table An outer join allows you to pull data from a table even when there is no matching records in the joining table. Currently, your queries are using inner joins which only pull data when there are matching records in both tables. I also notice that you are using older T-SQL syntax, so to do an outer join in the older syntax you need to use *= for left outer join and =* for right outer join. You will list the table after the from clause and then in the where clause instead of using fielda = fieldb, use fielda *= fieldb (for left outer join) or fielda =* fieldb (for right outer join). I hope this is what you were looking for.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号