Showing posts with label bunch. Show all posts
Showing posts with label bunch. Show all posts

Friday, March 23, 2012

how to get the highest row from the bunch of rows

hi...i just want to retrieve the highest row from the collection of
rows like...my table is:
name year
a 2008
a 2006
b 2007
b 2006
b 2005
c 2007
c 2004
I just need the latest year for all the names like:
name year
a 2008
b 2007
c 2007
THANKS..."sql_learner" <mailfrd@.gmail.com> wrote in message
news:eafce7c0-7c49-415e-b410-336593650ce2@.s8g2000prg.googlegroups.com...
> hi...i just want to retrieve the highest row from the collection of
> rows like...my table is:
> name year
> a 2008
> a 2006
> b 2007
> b 2006
> b 2005
> c 2007
> c 2004
> I just need the latest year for all the names like:
> name year
> a 2008
> b 2007
> c 2007
> THANKS...
SELECT name, MAX(year) year
FROM tbl
GROUP BY name;
--
David Portas|||sql_learner wrote:
> hi...i just want to retrieve the highest row from the collection of
> rows like...my table is:
> name year
> a 2008
> a 2006
> b 2007
> b 2006
> b 2005
> c 2007
> c 2004
> I just need the latest year for all the names like:
> name year
> a 2008
> b 2007
> c 2007
> THANKS...
SELECT name,MAX(year)
FROM tablename
GROUP BY name
... p
--
Posted via a free Usenet account from http://www.teranews.com

Wednesday, March 21, 2012

how to get text (html) from "Render" method

currently i'm getting a stream back and am using [see code at end] to convert
it
what i get back on the screen is a bunch of crap like this
MIME-Version: 1.0 Content-Type: multipart/related;
boundary="--=_NextPart_01C35DB7.4B204430" X-MSSQLRS-ProducerVersion:
V8.00.878.00 This is a multi-part message in MIME format.
--=_NextPart_01C35DB7.4B204430 Content-ID: Content-Disposition: inline;
filename="DASH0014" Content-Type: text/html; name="DASH0014"; charset="utf-8"
Content-Transfer-Encoding: base64
PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEgVHJhbnNpdGlvbmFs
Ly9FTiI+DQo8aHRtbD4NCjxoZWFkPg0KPHRpdGxlPg0KREFTSDAwMTQNCjwvdGl0bGU........................etc
instead of what i was expecting - a nicely formed html doc
is it because i am converting the stream?
is there a better way of handling the stream?
am i using the wrong encoding?
thanks
a.
--CODE START
Dim result As Byte() = Nothing
...
result = rs.Render(Report, Format, HistoryID, DeviceInfo,
Parameters, Credentials, _
ShowHideToggle, Encoding, MIMEType, ParametersUsed, Warnings,
StreamIDs)
Dim star As String
Dim ec As System.Text.Encoding = System.Text.Encoding.UTF8
star = ec.GetString(result)
Message.InnerHtml = star
--CODE ENDok so i set this and it works
Dim Format As String = "HTML4.0"
(it was "MHTML")
but now i have a new problem
"adolf garlic" wrote:
> currently i'm getting a stream back and am using [see code at end] to convert
> it
> what i get back on the screen is a bunch of crap like this
> MIME-Version: 1.0 Content-Type: multipart/related;
> boundary="--=_NextPart_01C35DB7.4B204430" X-MSSQLRS-ProducerVersion:
> V8.00.878.00 This is a multi-part message in MIME format.
> --=_NextPart_01C35DB7.4B204430 Content-ID: Content-Disposition: inline;
> filename="DASH0014" Content-Type: text/html; name="DASH0014"; charset="utf-8"
> Content-Transfer-Encoding: base64
> PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEgVHJhbnNpdGlvbmFs
> Ly9FTiI+DQo8aHRtbD4NCjxoZWFkPg0KPHRpdGxlPg0KREFTSDAwMTQNCjwvdGl0bGU........................etc
> instead of what i was expecting - a nicely formed html doc
> is it because i am converting the stream?
> is there a better way of handling the stream?
> am i using the wrong encoding?
> thanks
> a.
>
> --CODE START
> Dim result As Byte() = Nothing
> ...
> result = rs.Render(Report, Format, HistoryID, DeviceInfo,
> Parameters, Credentials, _
> ShowHideToggle, Encoding, MIMEType, ParametersUsed, Warnings,
> StreamIDs)
> Dim star As String
> Dim ec As System.Text.Encoding = System.Text.Encoding.UTF8
> star = ec.GetString(result)
> Message.InnerHtml = star
> --CODE END
>sql