473,473 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1338
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 230px and the columns on the right/left (always the...
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 looked at the docs, it mentioned that table names...
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! UPDATE , Issue SET .IssueID = . WHERE ((.=.));
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 and I'm not looking for someones help to design my...
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 visible / invisible. (However within each table, there...
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 until now. However it doesn't seam to function...
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 each query is blocking for the same amount of time...
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 more CSS clue look over it, but I haven't had any...
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 tables: 1) MUSIC - containing music release...
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 databases. If someone could help me with this issue I'm...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.