Identify Last Record

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Identify Last Record

    I'm returning a SQL recordset that uses "With Rollup" to render totals as
    the last record. Normally I simply loop through recordset and response.write
    each record adding HTML tags. However, I'd like to make the last record bold
    to show it's a total.

    How can I determine that a particular record is the last one?

    My usual syntax is
    Do While Not objRS.EOF
    ... Loop through records


    Scott Guest

  2. Similar Questions and Discussions

    1. Identify type of PDF
      A PDF has been sent to me and I want to identify whether it is press-ready, print-ready, etc. I preflighted it and found low-res images and JPEGS, so...
    2. Can anyone identify this site please?
      Hi all and apols for re-posting About a year ago I downloaded a bunch of funky flash sites - the link is to a part of an image from one that I...
    3. Can't identify font
      I have a Logo that I made prior to my hard disk crashing. since I have replaced the hard drive and reinstalled AI, I don't seem to have the font...
    4. identify a font
      I have to make changes to a page created by someone else. The page contains text that was converted to graphics. I need to make new graphics, but I...
    5. Identify Hackers?
      "Joe Maloney" <jpmaloney@sutv.com> wrote in message news:%23tn2yhdPDHA.3664@tk2msftngp13.phx.gbl... using person firewall program, insight ...
  3. #2

    Default Re: Identify Last Record

    When you reach the rollup row, aren't there NULL values in columns to the
    left of the sum?

    For example, with the following query against the pubs database:

    select discount, avg(discount) from discounts
    group by discount with rollup

    The last row has NULL for discount. If this doesn't help, can you show your
    query?

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]




    "Scott" <sbailey@mileslumber.com> wrote in message
    news:#in8JFFwDHA.2080@TK2MSFTNGP10.phx.gbl...
    > I'm returning a SQL recordset that uses "With Rollup" to render totals as
    > the last record. Normally I simply loop through recordset and
    response.write
    > each record adding HTML tags. However, I'd like to make the last record
    bold
    > to show it's a total.
    >
    > How can I determine that a particular record is the last one?
    >
    > My usual syntax is
    > Do While Not objRS.EOF
    > ... Loop through records
    >
    >

    Aaron Bertrand [MVP] Guest

  4. #3

    Default Re: Identify Last Record

    I have it rendering "Total" and just realized I can test for that word.
    Thanks again.

    "Aaron Bertrand [MVP]" <aaron@TRASHaspfaq.com> wrote in message
    news:eL9XApFwDHA.3220@tk2msftngp13.phx.gbl...
    > When you reach the rollup row, aren't there NULL values in columns to the
    > left of the sum?
    >
    > For example, with the following query against the pubs database:
    >
    > select discount, avg(discount) from discounts
    > group by discount with rollup
    >
    > The last row has NULL for discount. If this doesn't help, can you show
    your
    > query?
    >
    > --
    > Aaron Bertrand
    > SQL Server MVP
    > [url]http://www.aspfaq.com/[/url]
    >
    >
    >
    >
    > "Scott" <sbailey@mileslumber.com> wrote in message
    > news:#in8JFFwDHA.2080@TK2MSFTNGP10.phx.gbl...
    > > I'm returning a SQL recordset that uses "With Rollup" to render totals
    as
    > > the last record. Normally I simply loop through recordset and
    > response.write
    > > each record adding HTML tags. However, I'd like to make the last record
    > bold
    > > to show it's a total.
    > >
    > > How can I determine that a particular record is the last one?
    > >
    > > My usual syntax is
    > > Do While Not objRS.EOF
    > > ... Loop through records
    > >
    > >
    >
    >

    Scott Guest

Posting Permissions

  • You may not post new threads
  • You may 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