Record Numbers against record problem...

D

David

Hi,

I have a .asp page which lists a date, then a bunch of record lines
for data that falls within that date, then the next date and it's
bunch of data record lines.

e.g.

Ship Date: 04/06/04

Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx

Ship Date: 11/07/04

Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx


What I want is:



Ship Date: 04/06/04

1: Data xxxxxxxxxxxxxxxxxxxxx
2: Data xxxxxxxxxxxxxxxxxxxxx
3: Data xxxxxxxxxxxxxxxxxxxxx
4: Data xxxxxxxxxxxxxxxxxxxxx

Ship Date: 11/07/04

1: Data xxxxxxxxxxxxxxxxxxxxx
2: Data xxxxxxxxxxxxxxxxxxxxx
3: Data xxxxxxxxxxxxxxxxxxxxx

How can I get these numbers printed againsts the records ?

Thanks in advance

David
 
A

Aaron [SQL Server MVP]

You're response.writing these things in a loop, right?

cShipDate = null
do while not rs.eof
if rs("shipdate") <> cShipDate then
cShipDate = rs("shipdate")
counter = 0
response.write "&nbsp;<br>Ship Date: " & _
cShipDate & "<p>"
end if
counter = counter + 1
response.write counter & ":" & rs("data") & "<br>"
rs.movenext
loop


What kind of date is 11/07/04? Is that April 7, 2011, or November 7, 2004,
or July 11th, 2004, or something else? You might think about using an
unambiguous and standard date format to avoid, at the very least, confusion.
 
J

John

shipDate = Record("shipDate")

Do

If shipDate <> Record("shipDate") then
nr=0
End If

nr=nr+1
Response.Write nr & ": " & record & "<br>"

Loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top