Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2011
    Posts
    30

    Unanswered: style of extract information

    hello to all again!
    I have a question.
    can I extract my results such as like this:


    week
    firstday | lastday

    day1 day2
    day3 day4

    etc etc etc

    firstday,lastday are column 's names from the table WeekRange.

    in the other words,I want to "print" some extra titles for my columns.
    is it possible??

    thanksss!

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    yeah, it's possible

    what are the extra titles? where do they come from?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jul 2011
    Posts
    30
    extra title is something like week,that I used before for example.

    "extra titles",there are not in any table.I want to write them into the code.

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    SELECT firstday  AS 'week
    firstday'
         , lastday
      FROM WeekRange
    note the line break in the column alias name
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Jul 2011
    Posts
    30
    thanks for your help.
    but it is not exactly that I want.

    I attach a doc so,you understand better that I want.


    thanks again!
    Attached Files Attached Files

  6. #6
    Join Date
    Mar 2007
    Location
    Holmestrand, Norway
    Posts
    332
    In my humble opinion, you should not worry so much about the presentation of the data. After all, this data is going to be presented to some kind of an application, right? It's up to the application to format the data properly, not SQL Server.

    You don't expect your users to use SQL Server Management Studio (or sqlcmd.exe) to perform their task do you?
    Ole Kristian Velstadbråten Bangås - Virinco - MSSQL.no - Facebook - Twitter

  7. #7
    Join Date
    Jul 2011
    Posts
    30
    you are right!
    now, I try to find the way to "convert" sql query to report format.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •