Professional Web Applications Themes

Help on output display - Microsoft SQL / MS SQL Server

Hi Ben It would have been more useful for understanding purposes if you posted some sample data along with table structure as fields to us make no sense as just by looking at them. My guess is you are looking for cross tab, pivoted table queries. Please refer to following articles: http://support.microsoft.com/default.aspx?scid=kb;EN- US;q175574 http://msdn.microsoft.com/library/en- us/acdata/ac_8_qd_14_04j7.asp http://www.sqlmag.com/Articles/Index.cfm?ArticleID=15608 http://www.sqlteam.com/item.asp?ItemID=2955 http://www.aspfaq.com/2462 You could also use these tools: http://www.rac4sql.net http://www.ag-software.com/xp_ags_crosstab.asp Ricky  ...

  1. #1

    Default Help on output display

    Hi Ben

    It would have been more useful for understanding purposes
    if you posted some sample data along with table structure
    as fields to us make no sense as just by looking at them.
    My guess is you are looking for cross tab, pivoted table
    queries. Please refer to following articles:


    http://support.microsoft.com/default.aspx?scid=kb;EN-
    US;q175574
    http://msdn.microsoft.com/library/en-
    us/acdata/ac_8_qd_14_04j7.asp
    http://www.sqlmag.com/Articles/Index.cfm?ArticleID=15608
    http://www.sqlteam.com/item.asp?ItemID=2955
    http://www.aspfaq.com/2462

    You could also use these tools:
    http://www.rac4sql.net
    http://www.ag-software.com/xp_ags_crosstab.asp



    Ricky
     
    Ricky Guest

  2. #2

    Default Re: Help on output display

    This is one method:

    CREATE TABLE #TABLE_DUH (
    aStart int default 10,
    aMiddle int default 15,
    aEnd int default 20,
    bStart int default 12,
    bMiddle int default 22,
    bEnd int default 32,
    cStart int default 22,
    cMiddle int default 32,
    cEnd int default 42)
    GO
    INSERT INTO #TABLE_DUH default values
    SELECT * FROM #TABLE_DUH
    GO
    SELECT 'column' = 'a', 'Start' = aStart, 'Middle' = aMiddle, 'End' = aEnd FROM #TABLE_DUH
    UNION
    SELECT 'column' = 'b', 'Start' = bStart, 'Middle' = bMiddle, 'End' = bEnd FROM #TABLE_DUH
    UNION
    SELECT 'column' = 'c', 'Start' = cStart, 'Middle' = cMiddle, 'End' = cEnd FROM #TABLE_DUH
    GO


    You could also choose to insert the data from the three select statements into a temp table and then retrieve the data from there.

    --
    Keith

    "ben" <com> wrote in message news:096e01c3632f$f9483ea0$gbl... 
    Keith Guest

  3. #3

    Default Re: Help on output display

    Thank You,

    This is exactly what I was looking for. Perfect!

    ben


     
    aMiddle, 'End' = aEnd FROM #TABLE_DUH 
    bMiddle, 'End' = bEnd FROM #TABLE_DUH 
    cMiddle, 'End' = cEnd FROM #TABLE_DUH 
    select statements into a temp table and then retrieve the
    data from there. 
    news:096e01c3632f$f9483ea0$gbl... [/ref]
    I [/ref]

    >.
    >[/ref]
    ben Guest

Similar Threads

  1. Question i need to display 3 decimal values in my output
    By Unregistered in forum Brainstorming Area
    Replies: 0
    Last Post: September 12th, 07:29 AM
  2. Replies: 3
    Last Post: August 31st, 02:22 AM
  3. [PHP] How to get exec() to display output from UNIX Shell Environemnt?
    By Reuben D. Budiardja in forum PHP Development
    Replies: 1
    Last Post: August 5th, 09:41 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139