Assigning a date display to the first occurence

J

J. Muenchbourg

I'm working on displaying the matchups of NFL teams for a given week,
and I need to display weekday abbreviations alongside of the visiting
teams' names . If a game is on Thursday, then Th gets displayed aside
the team's name. But I only want to display the Sunday "su" abbreviation
by just the first team whose game appears on sunday. I declare su1,
initialize it with a 0, but even tho i increment the value when it
occurs once, and then compare it to the value of 1 next time thru the
loop, i still gets the "Su" s displayed by each and every game for that
sunday, what is what I don't want:

<%dim su1
su1 = 0
if myweekday = 2 then
response.write "Mo"
elseif myweekday = 5 then
response.write "Th"
elseif myweekday = 7 then
response.write "Sa"
elseif myweekday = 1 and su1 = 0 then
su1 = su1 + 1
response.write "Su"

end if%>

???
Muench, thanks
 
J

Jeremy Markman

I assume you have a recordset loop and you test for the day of the
week inside the loop.

In the code you posted, you are initializing su1 = 0. Is this
assignment statement in your loop? If you reset su1 within your loop,
then it will always be 0 even after you increement it and you will be
able to keep track of the fact that you displayed it already.

Can you show more code of the entire loop structure?

Jeremy
 

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

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,118
Latest member
LatishaWhy
Top