Display No Comment In The Text If There Is No Data

Oct 3, 2007



Hi all,

I have a report where I have to display State, Category Name and the text. Below is the sample report


State Category Name Text


TX Unanticipated High NT due to RADD clean up- drive replacement.

NJ Unanticipated SAR efforts (SEM configuration)


But now my question is if there is no comment in any other state I would like to show no comment in the text line. Is there any formula I can use in the report level that will take care of the issue. I know in Business object there is a formula you can create which is =If (IsNull([Text]);"No Comments Reported";[Text]). I need to know in ssrs there is something.

please let me know ASAP and the steps of doing that.

Thanks

Rozarm02

View 8 Replies


ADVERTISEMENT

Remove A Comment String From Text Field

Oct 24, 2007

I have a field that contains some text. Each field will have none or atleast one comment in it. A comment can be a string of any length with *** on both sides. Ex: ***comment***


Declare @Test_tbl Table(TextField Text)
Insert Into @Test_tbl
Select 'Some text ***comment*** some more text' Union all
Select 'Other text ***another comment*** more and more text' Union all
Select '***Comment*** some text ***More Comments***' Union all
Select 'some text with no comment'


I need the output be ...

TextField
--------------
Some text some more text
Other text more and more text
some text
some text with no comment




Thanks in advance.

View 4 Replies View Related

Text And Sum Display Data

Jan 28, 2015

I want to output this result. how to write this query? "This is new amount 1000" select "This is new amount "+@sum(amt) as amount from table

View 2 Replies View Related

SQL Insert From Text Box Works, But Can't Display Data After

Jan 4, 2008

Ok so I got my insert statement to work properly from multiple text boxes and a button control.  What I'm looking to do is once the customer hits the button and it creates the new row in the table I want to then display the recently created record.  Currently when I hit submit it creates the record, but the screen then goes back to default.  I can then go to another page that I created to browse the records and it sees that the record was created properly.  I would like for the insert to complete and then for the recently created record to be displayed either with a pop up, on the same page, or on a different page that needs to be created.  I've tried tons of different options, but haven't been able to figure it out.  So what I'll do is show you the working code and if you could give me a little help on what code I need to add to accomplish the task.  Thanks.   <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">    <b />    <table style="width:100%;">        <tr>            <td class="style9">                Enter Bug Title:</td>            <td>    <asp:textbox id="bug_title" runat="server" Width="420px" EnableViewState="False"/>                                </td>        </tr>        <tr>            <td class="style9">                Bug Tester:</td>            <td>                <asp:TextBox ID="tester" runat="server" width="420px" EnableViewState="False"/></td>        </tr>        <tr>            <td class="style12">                Description:</td>            <td class="style13">                <asp:TextBox ID="description" runat="server" Width="420px" Height="473px"                     EnableViewState="False" MaxLength="200" TextMode="MultiLine"></asp:TextBox>                                </td>        </tr>        <tr>            <td class="style9">                Severity:</td>            <td>                <asp:DropDownList ID="severity" runat="server" EnableViewState="False">                    <asp:ListItem>Low</asp:ListItem>                    <asp:ListItem>Medium</asp:ListItem>                    <asp:ListItem>High</asp:ListItem>                </asp:DropDownList>            </td>        </tr>        <tr>            <td class="style9">                Project Group:</td>            <td>                <asp:DropDownList ID="project_group" runat="server"                     DataSourceID="ObjectDataSource1" DataTextField="GroupName"                     DataValueField="GroupName" EnableViewState="False">                </asp:DropDownList>                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"                     OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"                     TypeName="DataSet1TableAdapters.bug_groupsTableAdapter">                </asp:ObjectDataSource>            </td>        </tr>        <tr>            <td class="style9">                &nbsp;</td>            <td>                <asp:button ID="button1" runat="server" text="Submit" OnclientClick="button1_click" />&nbsp;</td>        </tr>    </table> And here is the code behind: Imports System.DataImports System.Data.SqlClientPartial Class Default2    Inherits System.Web.UI.Page    Dim objcon As ConnectionStringSettings = ConfigurationManager.ConnectionStrings("bug_trackerConnectionString")    Dim str As String = objcon.ConnectionString    Dim con As New SqlConnection(Str)    Dim com As New SqlCommand("", con)    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click        con.Open()        com.Parameters.AddWithValue("@bug_title", bug_title.Text)        com.Parameters.AddWithValue("@tester", tester.Text)        com.Parameters.AddWithValue("@description", description.Text)        com.Parameters.AddWithValue("@project_group", project_group.Text)        com.Parameters.AddWithValue("@severity", severity.Text)        com.CommandText = "INSERT INTO bug_tracker (bug_title, tester, description, severity, project_group) VALUES (@bug_title, @tester, @description, @severity, @project_group)"        com.ExecuteNonQuery()        con.Close()    End Sub 

View 1 Replies View Related

Display Numeric Data As Text String?? Spell Out Number

Nov 5, 2007

How do I display numeric data as text string?? I need the report to spell out the number. 1 would read as One, 2 as Two ect. For example writing the amount on a check. Need to do in SSRS.

View 6 Replies View Related

Reporting Services :: Display Columns When There Is No Data To Display

Apr 30, 2015

I would like to display a portion of report where there is data or no data

There is data subreport  display   

     Product Name Latex Gloves  
     Product ID      
xxxx5678

 There NO data in the subReport
 
  Product Name                          
   Product ID    

View 3 Replies View Related

Different Display Based On Text

Jan 30, 2004

I have an HTMP form and for some reason, when I use a regular TextBox to display a field, Via an ASP conneciton to the database, it cuts it off when it gets to a " (A quote)

Example:

Field: Title
Data: Where do "rabbits" come from?

If I try to pull that field into a regular html textbox it dispays,

Where do

Then if I change the textbox to a textarea it displays the entire field

Where do "rabbits" come from?

Is this a setting that causes this in SQL Server on the table.

I am new to SQL Server and am trying to learn these little differences.

Any help would be greatly appreciated.

Thanks,

View 2 Replies View Related

RS2k - Display Text To Say There Are No Rows?

Jul 9, 2007

Hi,



This is probably an easy one, but its been bugging me.



If I have no rows for a particular table, is there any way that I can simply display some text saying something like 'no data available for report' ?



Similarly, I was thinking I could hider certain controls on the report if there are no rows available by using an expression in the Visible property of the control.



Any suggestions are appreciated.



Regards.



MrPeds

View 1 Replies View Related

Work Around To Display RTF Text In RDLC?

Apr 18, 2008



Hi,

We had come a long way in implementing reports using RDLC and now we are stuck with the requirement to display RTF text using RDLC.

Is there a way to display a RTF Text in RDLC in a purely managed code?

The links mentioned below provides a work around solution to this but a part of its implementation is in un-managed code.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=551939&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=738557&SiteID=1

Iam also curious to know if Microsoft has released a patch or service pack that supports RTF in RDLC?

Iam using .NET 3.0 with SP1 and my backend is MS-SQL Server 2005 Express Edition.

Thanks & Regards
Arvind T N

View 1 Replies View Related

Display Programatically Images,text In A Page

Sep 14, 2004

hi everyone.
i want to build a page that all datas,images will store in sql server.
i want to display images,text from database in a page with a template (images left of the page,text near the image and like....,programatically)
there will be very much data . about 500-1000 pages data.
is this possible with sql server?
can SQL server store big datas?
if it is possible can you give me an idea.

View 1 Replies View Related

Split Text Field - Display 1st Or 2nd Word

Sep 24, 2012

In SQL SErver 2008, I have a text column. I need to display either 2nd word in the text column or 1st word in the text column based on certain conditions.

How shall i display either 2nd word or 1st word from a text field.

View 1 Replies View Related

How To Display My Report In Text File Using SSRS?

Nov 14, 2007

Hi guys,

I have reports in text files, with the formatting and alignments all intact, and need not to be changed anymore. But then, if I were to display these reports using IE, the best choice I have would be using SSRS. But then, is there such a feature in SSRS where I can do that? Just to display these reports as they are?

Please help

Thanks!

View 1 Replies View Related

How To Display The Selected Multi-value Report Parameter/s In A Text Box?

Mar 19, 2008



Hi All,

I have a report parameter which i multivalue. I want to display the selected value in a text box. I have written the following code :


=Switch(Parameters!ServiceAttribute.Count = 1,Parameters!ServiceAttribute.Value(0),

Parameters!ServiceAttribute.Count = 2,(Parameters!ServiceAttribute.Value(0) & ", " & Parameters!ServiceAttribute.Value(1)))



Which suggests that if only one of the two multivalue parameter id is selected display the same (Parameters!ServiceAttribute.Value(0)).

This works fine when i select both the attributes but throws an exception "Index was outside the bounds of the array" when i select only one of the parameters. Can anyone help me with that?

Also i want this report parameter to allow null i.e. if a user does not select anything he should still be able to view the report.
In case of regular dropdowns i have added a <Null> value to the existing values and set the default to null. But in case of multi-value, it does not give an option of adding <Null>

View 5 Replies View Related

SSRS Newbie - How To Display Rich Text In A Report

Aug 21, 2007

Hi

(Note when I say "rich" text I don't specifically mean rich text, I'm refering to text with user defined bold, italic, numbered lists, colors, fonts, etc.)

We have a (new) system where we want a user to enter "rich" text notes into a single column using an editor embedded in our application (much like the editor I'm using for this forum) and have the notes displayed correctly in SSRS reports. We were thinking of storing the notes as HTML but I've just tried it and the report displays the whole HTML string, rather than marking up the text.

We are open to marking up the text using any mechanism, rich text, HTML, Word, etc. just as long as we can see it in the reports.

We also need to consider viewing the same notes via Crystal reports.

Thanks in advance for any advice.

Michael

View 3 Replies View Related

Text Field To Display Date Parameter Chosen

Mar 26, 2008

Hi,

I'm attempting to use the following code to display either 'All' or the date value selected by the user from a Report parameter;

=iif(Parameters!FromCheckOutDateDate.Value.ToString = "[Check Out Date].[Date].[All]", "All", "From Date: " + Parameters!FromCheckOutDateDate.Value.ToString.Substring(26,10))

This is throwing an error ('#Error').

I can use the following code with no error, though its not as useful;

=iif(Parameters!FromCheckOutDateDate.Value.ToString = "[Check Out Date].[Date].[All]", "All", "Not all")

I can even use this to display the selected value (i.e. 2007-01-01);

Parameters!FromCheckOutDateDate.Value.ToString.Substring(26,10)

Why can't I use them both in my iif statement?

Can someone please help?

View 2 Replies View Related

Do Not Display The Result Of My Long Text String, Approx About 400 Characters

Mar 26, 2004

I have the following problem. My SQL Query that i wrote works but the result that is displayed in Query analyzer cuts most of my long text that I want in my result. The long text string is approx about 400 characters and the type is varchar of the field. Any ideas??

SELECT '510', PRODCLASSID
, '1', COMPONENTID,'ENG'+SPACE(2),'#'+SPACE(254),'#'+SPAC E(254),'#'+SPACE(254),'#'+SPACE(99),externalid,
'Desc1' = CASE
WHEN SUBSTRING(externalid,1,2) = 'MF'
THEN 'Full machine warranty : parts, labour, mileage and others covered at warranty rates applicable at the time of repair. '
WHEN SUBSTRING(externalid,1,2) = 'MP'
THEN 'Full machine warranty, parts only : parts covered at warranty rates applicable at the time of repair. '
WHEN SUBSTRING(externalid,1,2) = 'PF'
THEN 'Power line warranty : parts, labour, mileage and others covered at warranty rates applicable at the time of repair. '
WHEN SUBSTRING(externalid,1,2) = 'PP'
THEN 'Power line warranty, parts only : parts are covered at warranty rates applicable at the time of repair. '
END
+
CASE
WHEN SUBSTRING(externalid,LEN(externalid)- 3,4) = '2018'
THEN 'Flexible warranty starts after the standard warranty period has expired and is covered up to 18 month or 2000 HRS, whichever comes first. '
WHEN SUBSTRING(externalid,LEN(externalid)-3,4) = '3024'
THEN 'Flexible warranty starts after the standard warranty period has expired and is covered up to 24 month or 3000 HRS, whichever comes first. '
WHEN SUBSTRING(externalid,LEN(externalid)-3,4) = '4030'
THEN 'Flexible warranty starts after the standard warranty period has expired and is covered up to 30 month or 4000 HRS, whichever comes first. '
WHEN SUBSTRING(externalid,LEN(externalid)-3,4) = '5036'
THEN 'Flexible warranty starts after the standard warranty period has expired and is covered up to 36 month or 5000 HRS, whichever comes first. '
WHEN SUBSTRING(externalid,LEN(externalid)-3,4) = '6042'
THEN 'Flexible warranty starts after the standard warranty period has expired and is covered up to 42 month or 6000 HRS, whichever comes first. '
WHEN SUBSTRING(externalid,LEN(externalid)-3,4) = '8054'
THEN 'Flexible warranty starts after the standard warranty period has expired and is covered up to 54 month or 8000 HRS, whichever comes first. '
WHEN SUBSTRING(externalid,LEN(externalid)-3,4) = '1074'
THEN 'Flexible warranty starts after the standard warranty period has expired and is covered up to 74 month or 10000 HRS, whichever comes first. '
END
+ 'Flexible warranty is handled according to the procedures described in ESPPM 3-10.'
+
CASE

WHEN prodclassid IN ('P1','P11','P8','P9')
THEN ' (mileage limited to 300 km)'
WHEN prodclassid IN ('P7')
THEN ' (mileage limited to 200 km)'
ELSE NULL
END
+
SPACE(5000 - LEN('Desc1'))
.......

View 1 Replies View Related

Reporting Services :: Field Value Text Display With IIF Statement Based On Two Parameter

Jul 9, 2015

I need to set a field value based on two date time parameter's.What is the correct syntax to allow me to pass the value into the field in my SSRS expression ?

=IIf(Parameters!EndDate > Parameters!StartDate.Value, "Overdue")

View 3 Replies View Related

Reporting Services :: Display Only First Few Words Of A Block Of Text With Show More Link At The End (SSRS 2012)

Nov 6, 2015

Is it possible to display only the first few words of a block of text with a "Show More" link at the end, which when clicked would expand the block to show all content?

"Collapsed":
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
<...show more>

"Expanded":
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<... show less>

View 2 Replies View Related

Can I Get A Comment Or Two On This

Sep 24, 2006

Hey guys,
I have a Access adp that backs onto SQL Server 2005, its taken a while but tis nearly done.

Just one last thing to figure out.. and thats how to send a email. I had a look at all the Access ways and they just wont work out for this.

So I decided to use the server to send them, I would insert/update a row into a table which has a trigger on it.

The table has amoung other things a Approved and Declined column.
Both at 0 Sends an email to an Approver
App 1 Dec 0 Sends on further
and App 0 Dec 1 sends back to the original sender.

All I really want to know is could a trigger execute a package or something that will send the email? (Yes thats right someone isnt asking for code for once:D meh must be winter in hell)

If theres any flaws in my idea please feel free to tell me (Saves me denting the desk with my head half a week and 10 pages of code from now)

And where do I create triggers:P (Will probly have found this one in BOL by the time anyone replys)

Sorry about this but I really have no clue about triggers.. seems the site doesnt like me searching for triggers
'This page was generated in 17.03 seconds.'
:P

View 2 Replies View Related

Comment Column

Apr 23, 2008

Hi

i have a comment column which is varchar(200). when a user types any say for example a couple of small paragraph with commas , colon, hard enter key.

when i run a select statement and save it to csv file and then open with excel, if the comments has comma then i get these info in separate column and if there is hard enter key then it goes into new line.

Is there a way to get these info in one column
Thanks,

View 2 Replies View Related

Comment On Replication

Jul 20, 2005

Hai friendsCould u pleas give me some noites on replication . I worked out thruwizards but not succeded.With thanksRaghu

View 1 Replies View Related

Comment To Table

Mar 26, 2008

Hello,

can I create a comment for a table in SQL Server 2005? For a column I can create a comment in the description-field.

finchen

View 3 Replies View Related

Replace Text/data In One Table With Corresponding Text/data From Another

Jan 10, 2006

Hi -

I've never used SQL for anything but simple copies and queries, and now I need to do something that's probably simple, as well, but I don't know how to start.  I need to update values in a text field with new values from another table.  I can do it individually with an update statement (Set [field1] = 'newvalue' where [field1] = 'oldvalue').  But I have 400 different values and a bunch of different tables that need to be updated, and can't imagine that's the only solution.  I can make up a simple table that will have all the old values in one column, and the new values in the next.  I need a statement that look at the old value, then fetch the new value from the table I made, and replace the old value with the new.

I've looked at various help files and tried to search for a solution elsewhere, but I'm not coming up with anything.  I guess I just don't know where to look.  Thanks in advance for any help you can give me.

Rebekkah

View 5 Replies View Related

Error: The Data Types Text And Text Are Incompatible In The Equal To Operator.

Apr 25, 2006

I get this error:
The data types text and text are incompatible in the equal to operator.
when trying to execute this query
SELECT id FROM users WHERE username=@userName
 
 
Any Ideas?

View 3 Replies View Related

Comment In Column Definition

Apr 30, 2007

Plesae tell me the MSSQL Server equivalent of the below MySQL query .create table temp2(a varchar(23) comment 'male m');What is the use of specifying a keyword 'comment' in the column definition. Will it make any difference

View 14 Replies View Related

T-SQL (SS2K8) :: Latest Comment Per ID

Jul 30, 2015

I want to get the latest comment for each id based on the maximum createdDate and not sure how to do this, tried to do Max but it was still returning all the rows.

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Audit](
[id] [nvarchar](64) NOT NULL,

[Code] ....

View 2 Replies View Related

Formatting A Subscription Comment

Nov 10, 2006

I have looked everywhere for an answer for this one, so if it's out there and I've missed it, sorry.

I want to include a list of instructions with a report that I am sending out to a list of subscribers (not Data Driven, each is an individual subscription). It seems no matter how I enter the text in the Comments box, the body of the email comes out as a continuous stream of text with no line breaks, which is difficult for the recipients to read.

Is there a way to embed line breaks as a minimum, but preferrably additional formatting, in a subscription comment?

Thanks

Trevor

View 4 Replies View Related

Getting Comment In Excel Cells

Apr 7, 2006

Hi,

Can any tell me how to check whether any Comment been entered in a Cell in the Excel Sheet?

It is pretty urgent. Solutions are greatly appreciable.

Thanks & Regards,

Prakash Srinivasan.

View 2 Replies View Related

Data Warehousing :: Query To Extract All Text After Hyphen From String Containing Comma Separated Text

Aug 27, 2015

I have a parameter value as shown below and this is dynamic and can grow 

Example : 101-NY, 102-CA, 165-GA
116-NY, 258-NJ, 254-PA, 245-DC, 298-AL
How do I get the values in the below format
NY,CA,GA   --- each state to be followed with comma and the next state
NY,NJ,PA,DC,AL   --- each state to be followed with comma and the next state

correct query that will fetch  only state names and not the numbers.

View 8 Replies View Related

Blog Select With Comment Count

Nov 22, 2003

The following sql works great when the field for my main blog message is type nvarchar but doesn't work for text which I need to convert to.

select
a.id, b.textField
count(b.a_id) as myCount
from a left join b on a.id = b.a_id
group by a.id, b.textField

What other methods could i use to get "myCount" within one sql statement?

Thanks in advance, Jeff

View 3 Replies View Related

Comment Syntax Breaks Code

May 26, 2000

inserted a record with an identity field
I had a '-- comment' right
Select @data = @@identity

This select failed - @data was NULL
I changed it to SET @data = @@identity
This also failed @data was null

I then change to the follow which worked - Why would the different form of a
comment make a difference? I was the only one in the database, there were no
other changes. I could make the logic block fail or succed by just changing
the comment syntax.

inserted a record with an identity field
I had a '/** comment**/' right
Select @data = @@identity

View 1 Replies View Related

Table Design Request For Comment. (Help Please)

Jul 14, 2006

Hi there gurus, can you please add your 2 cents on this design? We'rehaving trouble relating these tables in a diagram because of the keys.Is it necesary to have the references setup? I would assume yes so theforign keys can be setup.If you look at this link, you'll see our diagram. In Red are therelationships that we would like to make for referential integrity, butcannot because of the keys.http://rullo.ca/linktome/QuestionsDB.jpgOur goal in all of this is to have a facility wherin we can store aquestion, that has multiple names over multiple Languages. Forinstance:-Q1| QNameID = 1 | "Do you have a dog in your appartment?" | LangID =1(eng)-Q1| QNameID = 2 | "Do you have a dog in your house?" | LangID =1(eng)-Q1| QNameID = 1 | "-French - Do you have a chien in your appartment?"| LangID = 2(fr)-Q1| QNameID = 2 | "-French - Do you have a chien in your house?" |LangID = 2(fr)The difficulty is when we try and put this in the group details table.We don't want to outline the Language, we'd just pass the language intoa proc to retreive a specific group with a specific language. If youfolks would be so kind as to add your comments to the design I would betruely grateful.CREATE TABLE [Question] ([QuestionID] [int] NOT NULL ,[SystemName] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOTNULL ,CONSTRAINT [PK_Question] PRIMARY KEY CLUSTERED([QuestionID]) ON [PRIMARY]) ON [PRIMARY]GOCREATE TABLE [QuestionAnswer] ([QuestionID] [int] NOT NULL ,[QuestionAnswerID] [int] NOT NULL ,[SystemName] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOTNULL ,CONSTRAINT [PK_QuestionAnswer] PRIMARY KEY CLUSTERED([QuestionID],[QuestionAnswerID]) ON [PRIMARY] ,CONSTRAINT [FK_QuestionAnswer_Question] FOREIGN KEY([QuestionID]) REFERENCES [Question] ([QuestionID])) ON [PRIMARY]GOCREATE TABLE [QuestionAnswerName] ([QuestionAnswerID] [int] NOT NULL ,[QuestionAnswerNameID] [int] NOT NULL ,[LanguageID] [int] NOT NULL ,[Name] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,CONSTRAINT [PK_QuestionAnswerName] PRIMARY KEY CLUSTERED([QuestionAnswerID],[QuestionAnswerNameID],[LanguageID]) ON [PRIMARY]) ON [PRIMARY]GOCREATE TABLE [QuestionGroup] ([QuestionGroupID] [int] NOT NULL ,[Name] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,CONSTRAINT [PK_QuestionGroup] PRIMARY KEY CLUSTERED([QuestionGroupID]) ON [PRIMARY]) ON [PRIMARY]GOCREATE TABLE [QuestionGroupDetails] ([QuestionGroupID] [int] NOT NULL ,[QuestionNameID] [int] NOT NULL ,[QuestionAnswerNameID] [int] NOT NULL ,[QuestionSortOrder] [int] NULL ,[AnswerSortOrder] [nchar] (10) COLLATE SQL_Latin1_General_CP1_CI_ASNULL ,[DisplayLevel] [int] NULL ,CONSTRAINT [PK_QuestionGroupDetails] PRIMARY KEY CLUSTERED([QuestionGroupID],[QuestionNameID],[QuestionAnswerNameID]) ON [PRIMARY] ,CONSTRAINT [FK_QuestionGroupDetails_QuestionGroup1] FOREIGN KEY([QuestionGroupID]) REFERENCES [QuestionGroup] ([QuestionGroupID])) ON [PRIMARY]GOCREATE TABLE [QuestionNames] ([QuestionID] [int] NOT NULL ,[QuestionNameID] [int] NOT NULL ,[LanguageID] [int] NOT NULL ,[Name] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,[Desciption] [nchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,[ControlTypeID] [uniqueidentifier] NOT NULL ,CONSTRAINT [PK_QuestionNames] PRIMARY KEY CLUSTERED([QuestionID],[QuestionNameID],[LanguageID]) ON [PRIMARY] ,CONSTRAINT [FK_QuestionNames_Question] FOREIGN KEY([QuestionID]) REFERENCES [Question] ([QuestionID])) ON [PRIMARY]GO

View 1 Replies View Related

CR/LF In Comment Field In Emails Sent Using DataDrivenSubscriptions

Mar 15, 2007

I am setting up a data driven subscription to send out an email which includes a report. The Sql for the data driven subscription outputs the EmailTo, Subject, Comment(Body) and some report parameters. My issue is with the Comment (Body) field which I would like to format with CR/LF to make the email body look neat and readable. I've tried many different permutations of inserting the CR/LF, From concatenating Char(13) + Char(10) in which the email does recognize the Cr/LF to concatenating binary 0x0D + 0x0A which after the first concatenation of binary nothing else can be concatenated. Here is the code I've tried:
---~~~~~~~~
declare @iEndDate datetime
set @iEndDate = dbo.fn_today()
Declare @Account_group int
Set @Account_group = 999
/*
DECLARE @mybin1 binary(5), @mybin2 binary(5)
SET @mybin1 = 0x0D
SET @mybin2 = 0x0A
*/
Declare @CrLf VarChar(5)
set @CrLf = CHAR(13) + CHAR(10)
Declare @Str1 VarChar(255)
Declare @Str2 VarChar(255)
Declare @Str3 VarChar(255)
Declare @Str4 VarChar(255)
Declare @Str5 VarChar(255)
Declare @Str6 VarChar(255)
Declare @Str7 VarChar(255)
Declare @Str8 VarChar(255)
Declare @Str9 VarChar(255)
Set @Str1 = 'Good Morning,'
Set @Str2 = 'We are exposed by '
Set @Str3 = 'Attached please find the margin call detail.'
Set @Str4 = 'Please let us know if you have any questions.'
Set @Str5 = 'Thank you.'
Set @Str6 = 'Please respond to:'
Set @Str7 = ''
Set @Str8 = ''
Set @Str9 = ''
declare @t table
(
EmailTo VarChar(255),
ReplyTo VarChar(255),
Subject VarChar(255),
Comment Text,
Account_group Int,
Trading_Account_Id Int,
Broker_Code_Ky VarChar(255),
EndDate Datetime
)
insert into @t
select
EmailTo = '', -- isnull(bf.firm_email,''),
ReplyTo = '',
Subject = 'Margin Call Notice: - ' + Trading_account_name + ' - Exposure: ' + '$' + Convert(varchar(20), convert(Money, Mark_amount),1) ,
Comment = @Str1 + @CrLf + @CrLf + @Str2 + '$' + Convert(varchar(20), convert(Money, Mark_amount),1) + '.' + @CrLf + @CrLf + @Str3 + @CrLf + @CrLf + @Str4 + @CrLf + @CrLf + @Str5 + @CrLf + @CrLf + @Str6 + @CrLf + @Str7+ @CrLf + @Str8 + @CrLf + @Str9,
Account_group = @Account_group,
Trading_Account_Id = trading_account_Id,
Broker_Code_Ky = EGS.Broker_Code_Ky,
EndDate = @iEndDate
from fni_ExposureGovernmentSummary (@iEndDate) EGS
join broker_group bg
on EGS.broker_code_ky = bg.broker_code_ky
Join broker_firm bf
on bg.fbe_firm_id = bf.broker_firm_id
Order by
Broker_Group_Name,
Trading_account_Name
select top 2 * from @t

--~~~~~~~~~~~~~

The Email my company is using is Lotus Notes.

The Question is how do I code the the Comment field so that my email will recognize the Cr/LF.

Thanks

Elias

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved