sql script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike Rogers

    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
  • John Bell

    #2
    Re: sql script

    See later post.

    "Mike Rogers" <mbrogers@comca st.net> wrote in message
    news:5c7daa60.0 309101854.70c59 0e9@posting.goo gle.com...[color=blue]
    > 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,[/color]
    total[color=blue]
    > 45676 fuel 123 .10 12.30 stops 3 50[/color]
    150[color=blue]
    >
    >
    > now just one ordernumber appears and its all on one line.
    >
    >
    > hope you can help, thanks for your time...
    >
    >
    > Mike[/color]


    Comment

    Working...