472,338 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,338 software developers and data experts.

Tables issue

Not sure if this is the right place to post this, but sure someone will
kindly advise if it isn't

I have data from a SQL recordset that i want to display in a different
format, current code :

counter=0
for d= 1 to -int((-(ubound(bdata,2) +1))/3)
response.write "<tr>"
for e= 1 to 3

for c=1 to 2
response.write "<td class='a'>"
if counter >= ubound(bdata,2) then
response.write "&nbsp;"
else
response.write bdata(c,counter)
end if
response.write "</td>"
next 'c
counter =counter +1
next 'e
response.write "</TR>"
next 'd

'next 'b
This write the array like

1 2 3

4 5 6

7 8

But i want to write the data like

1 4 7

2 5 8

3 6

Can anyone advise how to change the code to do this ?

Regards, with mental block

John
May 11 '07 #1
2 1305
On May 11, 11:19 pm, "John Peach" <john.pe...@zen.co.ukwrote:
Not sure if this is the right place to post this, but sure someone will
kindly advise if it isn't

I have data from a SQL recordset that i want to display in a different
format, current code :

counter=0
for d= 1 to -int((-(ubound(bdata,2) +1))/3)
response.write "<tr>"
for e= 1 to 3

for c=1 to 2
response.write "<td class='a'>"
if counter >= ubound(bdata,2) then
response.write "&nbsp;"
else
response.write bdata(c,counter)
end if
response.write "</td>"
next 'c
counter =counter +1
next 'e
response.write "</TR>"
next 'd

'next 'b

This write the array like

1 2 3

4 5 6

7 8

But i want to write the data like

1 4 7

2 5 8

3 6

Can anyone advise how to change the code to do this ?

Regards, with mental block

John
Let's get the disclaimers over with - it's very late where I am and
this code is completely untested *and* I can't completely understand
everything in your code ..... however I think the following will give
you enough of a flavour of what you could do to allow you to adapt it
to your own situation.

In essence you need to store the input data in an intemediate array
and then access the the 'columns' as if they were 'rows' and vica-
versa. In my code arrData is a the input data out of the database. I
store this temporarily in arrWork and then walk back over arrWork but
this time reversing the sense of 'columns' and 'rows'.

As I say it's completely untested but it might nudge you where you
need to go...

for iRow = 1 to UBound(arrData,2)
for iCol = 1 to 3
arrWork(iRow,iCol) = arrData(iRow,iCol)
iCounter = iRow
next iCol
next iRow

response.write "<table>"
for iCol = 1 to 3
response.write "<tr>"
for iRow = 1 to iCounter
response.write "<td>" & arrWork(iRow,iCol) & "</td>"
next iRow
response.write "</tr>"
response.write "</table>"
May 11 '07 #2
Thanks for your reply, it has nudged me lol Have a good nights sleep :)

"northof40" <sh*********@gmail.comwrote in message
news:11**********************@y80g2000hsf.googlegr oups.com...
On May 11, 11:19 pm, "John Peach" <john.pe...@zen.co.ukwrote:
>Not sure if this is the right place to post this, but sure someone will
kindly advise if it isn't

I have data from a SQL recordset that i want to display in a different
format, current code :

counter=0
for d= 1 to -int((-(ubound(bdata,2) +1))/3)
response.write "<tr>"
for e= 1 to 3

for c=1 to 2
response.write "<td class='a'>"
if counter >= ubound(bdata,2) then
response.write "&nbsp;"
else
response.write bdata(c,counter)
end if
response.write "</td>"
next 'c
counter =counter +1
next 'e
response.write "</TR>"
next 'd

'next 'b

This write the array like

1 2 3

4 5 6

7 8

But i want to write the data like

1 4 7

2 5 8

3 6

Can anyone advise how to change the code to do this ?

Regards, with mental block

John

Let's get the disclaimers over with - it's very late where I am and
this code is completely untested *and* I can't completely understand
everything in your code ..... however I think the following will give
you enough of a flavour of what you could do to allow you to adapt it
to your own situation.

In essence you need to store the input data in an intemediate array
and then access the the 'columns' as if they were 'rows' and vica-
versa. In my code arrData is a the input data out of the database. I
store this temporarily in arrWork and then walk back over arrWork but
this time reversing the sense of 'columns' and 'rows'.

As I say it's completely untested but it might nudge you where you
need to go...

for iRow = 1 to UBound(arrData,2)
for iCol = 1 to 3
arrWork(iRow,iCol) = arrData(iRow,iCol)
iCounter = iRow
next iCol
next iRow

response.write "<table>"
for iCol = 1 to 3
response.write "<tr>"
for iRow = 1 to iCounter
response.write "<td>" & arrWork(iRow,iCol) & "</td>"
next iRow
response.write "</tr>"
response.write "</table>"


May 11 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mario T. Lanza | last post by:
Greetings, I've been working on a 3-column layout where the center column is of a fixed width (230px wide). The center column must always be...
11
by: RdR | last post by:
Hi, I am using Q Replication, I need to set to logging to capture changes on a table but the table has more than 18 characters for the name, I...
3
by: Megan | last post by:
hi everybody- it seems like my update query should work. the sql view seems logical. but that might be up to discussion...lol...i'm a newbie! ...
11
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access...
1
by: Jason Shohet | last post by:
Someone in my group created an aspx with 12 tables on it, each with several rows in the table. In codebehind, we often make 1 or more tables...
8
by: ignatova | last post by:
Hello, I have been using IBM Net Search Extender to perform full text searches on text columns in relational tables in DB2 without any problems...
3
by: loosecannon_1 | last post by:
I get a 90-120 second blocking when send 15 or so simultaneous queries to SQL Server 2000 that query a view made up of two joined tables. After...
4
by: metoikos | last post by:
I've scoured the web (clumsily, I'm sure) for information on the difficulties I am having, checked my markup in validators, and had a friend with...
5
by: NickCR_04 | last post by:
Hi all, I am (using ASP.net 2.0 in Visual Web developer 2005 Express Edit) trying to set up an asp front end to a music DB which has 2 main...
1
by: smaczylo | last post by:
Hello, I've recently been asked to work with Microsoft Access, and while I feel quite comfortable with Excel, I'm at a complete loss with...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.