January 10, 2006 at 1:36 pm
I use the code below to produce 3 reports who's results are stored in an email. I used the SELECT '''' to add a blank line in between the reports (or Result Sets) but it appears the SELECT is added a line with four dashes (----). Is there any way to get rid of the four dashes? We have SQL 2000 (SP3).
Thanks in advance, Kevin.
DECLARE @SQLString As VarChar(2000)
SET @SQLString =
'select name Manager,Round(sum(paymv+recmv),0)Total ,Convert(Varchar,settledate,101) Settledate
from germ.dbo.fxdaily
where dt = (select max(dt) from germ.dbo.fxdaily)
group by name,settledate
order by name,settledate
SELECT ''''
select Round(sum(paymv+recmv),0)Total ,Convert(Varchar,settledate,101) Settledate
from germ.dbo.fxdaily
where dt = (select max(dt) from germ.dbo.fxdaily)
group by settledate
order by settledate
SELECT ''''
select Round(sum(paymv+recmv),0)Total
from germ.dbo.fxdaily
where dt = (select max(dt) from germ.dbo.fxdaily)'
EXEC xp_sendmail @recipients='kgoodwyn',
@query = @SQLString,
@subject = 'Currency Managers Rollover Numbers Report',
@attach_results = 'FALSE', @width = 200, @separator='|'
GO
January 10, 2006 at 8:51 pm
Instead of the Select '''', try using Print '''' . It worked for me!
Aunt Kathi Data Platform MVP
Author of Expert T-SQL Window Functions
Simple-Talk Editor
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply