troubleshooting Question

asp classic loop through and show variable once in a table

Avatar of Wayne Barron
Wayne BarronFlag for United States of America asked on
ASPVB Script
3 Comments1 Solution7 ViewsLast Modified:
Hello, All.
I am trying to get the Quarterly of the months to show as the TOP ROW of a table, for each corresponding set of months.
If I run the following code. <%=ch%>
From the source before, it shows the Quarter for each record, but, of course, it shows it on every row, not at the start of it.

In the "Example HTML Output" below, you will see what I would like the output to be like.

ASP Code
<%while not rsHours.eof
if not rsHours.eof then
chQuarter = DatePart("q", rsHours("PayDate"))
end if
if chQuarter=1 then
ch="First Quarter"
end if
if chQuarter=2 then
ch="Second Quarter"
end if
if chQuarter=3 then
ch="Third Quarter"
end if
if chQuarter=4 then
ch="Forth Quarter"
end if
The Variable in the table.
<tr><td class="tdRight"><%=ch%></td></tr>

The output should look like this.<br />
Having the Quarter name on top of that Monthly Quarter.
In this case, we have the first two quarters of the year shown in the table below.
Example HTML Output
<tr><td class="tdRight">Date of Pay</td></tr>
<tr><td class="tdRight">Second Quarter></td></tr>
<tr><td class="tdRight">2021-05-02</td></tr>
<tr><td class="tdRight">2021-04-25</td></tr>  
<tr><td class="tdRight">2021-04-18</td></tr>  
<tr><td class="tdRight">2021-04-11</td></tr>
<tr><td class="tdRight">2021-04-04</td></tr>
<tr><td class="tdRight">First Quarter></td></tr>
<tr><td class="tdRight">2021-03-28</td></tr>
<tr><td class="tdRight">2021-03-21</td></tr>
<tr><td class="tdRight">2021-03-14</td></tr>
<tr><td class="tdRight">2021-03-07</td></tr>
<tr><td class="tdRight">2021-02-28</td></tr>
<tr><td class="tdRight">2021-02-14</td></tr>
Thanks all.
David H.H.Lee
Digital Marketing (Hospitality)
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros