Showing posts with label content. Show all posts
Showing posts with label content. Show all posts

Sunday, March 25, 2012

Distinct problem - how can I sort this?

Hi All

I have a table sent to me from another source over which i have no control of the content (they don't sem to be able to get a distinct instance of persons for some reason? - anyway that is out of my control)
Now this table contains multiple instances of persons, each person has a unique identifier plus a set of dates and a field that indicates the state of that person (can be 'Curr' or 'Ex').

Fields are as follows:-

PersonID - char(10) - This is unique identifier for each person
Date1 - DateTime
P_State - char(20)

Sample of data from table1:-
-
PersonID - Date1 - P_State
A11324 1998-04-21 Curr
A11324 1999-05-01 Ex
A11324 1998-07-12 Ex
A11324 1998-05-23 Curr
B44321 1999-07-01 Curr
B11111 1999-07-01 Ex
B11111 1998-03-01 Curr
B22222 1999-03-31 Ex
B22222 1998-04-11 Curr
B33333 2004-03-10 Curr
B44443 2002-09-01 Curr
-

What I need to get is the latest instance of each person and their present p_state, I've tried many ways but can't seem to get a distinct instance of the latest record for each person, can anyone point me in the right direction please.

thanks.

select personid,max(date1),p_state

from table1

group by personid,p_state

|||thanks
but that doesn't give me a single instance of each person?

It's much the same as

select personid,date1,p_state
from table1
order by personid,date1

is it not ?

edit
Sorted now thanks, I removed the p_state in your query and then used the output as a basis for another query.

Thanks.

Monday, March 19, 2012

Displaying RTF Content in Report

Hi
I am having rtf stuff in database.
I need to display it in the Report.
Is ther any way to render rtf text in the report
or Is there any way to remove rtf stuff and just display plain text.
I Tried to use RichTextBox object of System.Windows.Forms.dll.
It worked well in design time preview tab.
But giving error at field where I used to display when I published to
Report Server and run the reportPlease tell me what solution you did for below mentioned problem
"Rama Prasad" wrote:
> Hi
> I am having rtf stuff in database.
> I need to display it in the Report.
> Is ther any way to render rtf text in the report
> or Is there any way to remove rtf stuff and just display plain text.
> I Tried to use RichTextBox object of System.Windows.Forms.dll.
> It worked well in design time preview tab.
> But giving error at field where I used to display when I published to
> Report Server and run the report

Friday, March 9, 2012

Displaying HTML or other Rich Text Format content in Reporting Ser

For a report I am creating, I need to display rich text format content, that
will be saved in the database, on a reporting services report. This data
will include bolds, bullets, italics, indents, etc.
Is there a way to show this content formatted correctly in Reporting
Services? We were planning on storing the data as HTML in the database but
reporting services is displaying the actual HTML code and not the content.
Does anyone have any ideas? Any help is greatly appreciated! ThanksSSRS only prints plain text. You can't display HTML or RTF.
"giggleraz" <giggleraz@.discussions.microsoft.com> wrote in message
news:B5F25DF8-285F-4052-A159-74E4863A9829@.microsoft.com...
> For a report I am creating, I need to display rich text format content,
that
> will be saved in the database, on a reporting services report. This data
> will include bolds, bullets, italics, indents, etc.
> Is there a way to show this content formatted correctly in Reporting
> Services? We were planning on storing the data as HTML in the database
but
> reporting services is displaying the actual HTML code and not the content.
> Does anyone have any ideas? Any help is greatly appreciated! Thanks|||Does anyone know if this will be possible in SQL 2005 RS? Surely this is a
basic requirement in a reporting tool
"Brian Bischof" wrote:
> SSRS only prints plain text. You can't display HTML or RTF.
>
> "giggleraz" <giggleraz@.discussions.microsoft.com> wrote in message
> news:B5F25DF8-285F-4052-A159-74E4863A9829@.microsoft.com...
> > For a report I am creating, I need to display rich text format content,
> that
> > will be saved in the database, on a reporting services report. This data
> > will include bolds, bullets, italics, indents, etc.
> > Is there a way to show this content formatted correctly in Reporting
> > Services? We were planning on storing the data as HTML in the database
> but
> > reporting services is displaying the actual HTML code and not the content.
> > Does anyone have any ideas? Any help is greatly appreciated! Thanks
>
>|||Not sure if this helps but what I had to do to get bullets was to start the
old Windows character map...not sure if it still comes with XP but if you
have an older version of windows such as 95 or 98 or 2000 you can start
character map by "Start" RUN and typing charmap.exe
Go to the Time New Roman font, scroll down about half way and you'll find a
BULLET (code 2022), you can copy it then paste it into a Textbox object and
it will display fine.
"IWantItalics" wrote:
> Does anyone know if this will be possible in SQL 2005 RS? Surely this is a
> basic requirement in a reporting tool
> "Brian Bischof" wrote:
> > SSRS only prints plain text. You can't display HTML or RTF.
> >
> >
> > "giggleraz" <giggleraz@.discussions.microsoft.com> wrote in message
> > news:B5F25DF8-285F-4052-A159-74E4863A9829@.microsoft.com...
> > > For a report I am creating, I need to display rich text format content,
> > that
> > > will be saved in the database, on a reporting services report. This data
> > > will include bolds, bullets, italics, indents, etc.
> > > Is there a way to show this content formatted correctly in Reporting
> > > Services? We were planning on storing the data as HTML in the database
> > but
> > > reporting services is displaying the actual HTML code and not the content.
> > > Does anyone have any ideas? Any help is greatly appreciated! Thanks
> >
> >
> >

Friday, February 24, 2012

display sql datas in xml file with stylesheet

hi,
can any one help me in displaying my sql database datas in an xml file and apply stylesheet to that displayed content.

thanks in advance...You have to learn how to write queries with
FOR XML EXPLICIT close.

Read this article for starters.

http://www.topxml.com/sql/for_xml_explicit.asp