Unix Technical Forum

sql script

This is a discussion on sql script within the SQL Server forums, part of the Microsoft SQL Server category; --> trying to make a script to view data in a excell spreadsheet. I can get all the data I ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 05:51 PM
Mike Rogers
 
Posts: n/a
Default sql script

trying to make a script to view data in a excell spreadsheet.

I can get all the data I need except one.

select ordernumber, itemcode, quantity, rate, total

from dbo.charges

where ordernumber = '45676'


the problem is there are more than one itemcode

example:

ordernumber, itemcode, quantity, rate, total
45676 fuel 123 .10 12.30
45676 stops 3 50 150

how do I get this data on one line?

to look more like this

ordernumber, itemcode, quantity, rate, total itemcode, quantity, rate, total
45676 fuel 123 .10 12.30 stops 3 50 150


now just one ordernumber appears and its all on one line.


hope you can help, thanks for your time...


Mike
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 05:53 PM
John Bell
 
Posts: n/a
Default Re: sql script

See later post.

"Mike Rogers" <mbrogers@comcast.net> wrote in message
news:5c7daa60.0309101854.70c590e9@posting.google.c om...
> trying to make a script to view data in a excell spreadsheet.
>
> I can get all the data I need except one.
>
> select ordernumber, itemcode, quantity, rate, total
>
> from dbo.charges
>
> where ordernumber = '45676'
>
>
> the problem is there are more than one itemcode
>
> example:
>
> ordernumber, itemcode, quantity, rate, total
> 45676 fuel 123 .10 12.30
> 45676 stops 3 50 150
>
> how do I get this data on one line?
>
> to look more like this
>
> ordernumber, itemcode, quantity, rate, total itemcode, quantity, rate,

total
> 45676 fuel 123 .10 12.30 stops 3 50

150
>
>
> now just one ordernumber appears and its all on one line.
>
>
> hope you can help, thanks for your time...
>
>
> Mike



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:07 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com