Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Select query hardcoded labels to appear bold

Author  Topic 

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2010-02-24 : 09:44:56
I am using the following to query, this is used via database mail to send emails.

is it possible to make the hardcoded field names to appear in bold?

Here is the query: For Example - Title:, Document Date:, From: to appear in bold

Select rcp.Email, getdate(),
''Title: '' + rtrim(m.rmtitle) + char(13)
+''Document Date: '' + rtrim(isnull(CONVERT(varchar(10),m.DocumentDate,101),'''')) + char(13)
+ ''Recv Date: '' + rtrim(isnull(CONVERT(varchar(10),m.ReceivedDate,101),'''')) + char(13)
+ ''From: '' + rtrim(isnull(m.OrigSender,'''')) + char(13)
+ ''Organization: '' + rtrim(isnull(m.OrigOrganization,'''')) + char(13)
+ ''To: '' +'+ @SQLField +' + char(13)
+ ''Distribution Date: '' + rtrim(isnull(CONVERT(varchar(10),rcp.sentdate,101),'''')) + char(13) + char(13)
+ ''Module: '' + rtrim(rcp.MODULENAME) + char(13)
+ ''Program: '' + pg.progno + '' - ''+ pg.progname + char(13)
+ ''Project: '' + pj.projno + '' - '' + pj.projname + char(13)
+ ''Contract: '' + ct.contractno + '' - '' + ct.contractname + char(13)
+ ''Log: '' + rtrim(isnull(ltype.englishtext,'''')) + char(13)
+ ''Sequence: '' + rtrim(isnull(m.SequenceNO,'''')) + char(13)+char(13)
+ ''Created/Modified By: '' + rtrim(isnull(m.UpdatedBy,'''')) + char(13)

+ ''Link To Record: http://'+ @mySite +'.mygroup.com/pcNewlogin.aspx?mktrte=srkc&gmd=' + rtrim(@ModuleName) + '&gidk=' + convert(nvarchar(50), @ModuleID) + '

''as body,



Thank you very much for the helpful info.

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2010-02-24 : 12:18:08
In general, it is best to leave the formatting issues to the application layer. The database is concerned with storing and retrieving data quickly and accurately.

It should be possible to insert the necessary control codes that would make the strings you are returning appear in bold. Find out what those codes are and insert tham into your strings.

=======================================
Few things are harder to put up with than the annoyance of a good example. (Mark Twain)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-24 : 12:26:00
are you trying to get this format for some email message?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -