Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How not to display first value???

Status
Not open for further replies.

ombina

Programmer
Jun 18, 2002
62
US
Hello,

I am trying to find out how not to display the first value when looping -

Results should look like this:

Product 1 stock
item 1 100
item 2 300
Total 400

Product 2 stock
item a 400
item b 800
Total 1200

NOT like this -

Total 100
Product 1 stock
item 1 100
item 2 300
Total 400

Product 2 stock
item a 400
item b 800
Total 1200
Thanks,

Ricky Ombina
ombina@yahoo.com
 
rs.moveFirst

Do While Not rs.eof

If left(rs(&quot;DESCRIPTION&quot;),3) <> &quot;ALL&quot; then

origCode = left(rs(&quot;DESCRIPTION&quot;),1)

If origCode = &quot;A&quot; then
codeDesc = &quot;Account Type&quot;
ElseIf origCode = &quot;E&quot; then
codeDesc = &quot;EEE&quot;
ElseIf origCode = &quot;C&quot; then
codeDesc = &quot;SSS&quot;
ElseIf origCode = &quot;K&quot; then
codeDesc = &quot;CCC&quot;
ElseIf origCode = &quot;I&quot; then
codeDesc = &quot;CCC&quot;
ElseIf origCode = &quot;S&quot; then
codeDesc = &quot;AAA&quot;
End If

'*************************************************************************************
If origCode <> lastCode then

response.write&quot; <tr>&quot;
response.write&quot; <td WIDTH=&quot;&quot;65%&quot;&quot; HEIGHT=&quot;&quot;10&quot;&quot; bgcolor=&quot;&quot;#EFEFEF&quot;&quot;>&quot;
response.write&quot; <p ALIGN=&quot;&quot;LEFT&quot;&quot;><b><font face=&quot;&quot;Arial&quot;&quot; size=&quot;&quot;1&quot;&quot;>&quot;
response.write&quot;TOTAL&quot;
response.write&quot;</font></b></td>&quot;

response.write&quot; <td WIDTH=&quot;&quot;20%&quot;&quot; HEIGHT=&quot;&quot;10&quot;&quot; bgcolor=&quot;&quot;#EFEFEF&quot;&quot; align=&quot;&quot;center&quot;&quot;><font FACE=&quot;&quot;Arial&quot;&quot; SIZE=&quot;&quot;1&quot;&quot;>&quot;
response.write&quot; <p ALIGN=&quot;&quot;RIGHT&quot;&quot;>&quot;
response.write formatNumber(totRec,0)
response.write&quot; </font></td>&quot;
response.write&quot; </tr>&quot;

response.write&quot; <tr>&quot;
response.write&quot; <td WIDTH=&quot;&quot;65%&quot;&quot; HEIGHT=&quot;&quot;10&quot;&quot; bgcolor=&quot;&quot;#FFFFFF&quot;&quot;>&quot;
response.write&quot; <p ALIGN=&quot;&quot;CENTER&quot;&quot;><b><font face=&quot;&quot;Arial&quot;&quot; size=&quot;&quot;1&quot;&quot;>&quot;
response.write ucase(codeDesc)
response.write&quot;</font></b></td>&quot;
response.write&quot; <td WIDTH=&quot;&quot;20%&quot;&quot; HEIGHT=&quot;&quot;10&quot;&quot; align=&quot;&quot;center&quot;&quot;><font FACE=&quot;&quot;Arial&quot;&quot; SIZE=&quot;&quot;1&quot;&quot;>&quot;
response.write&quot; <p ALIGN=&quot;&quot;RIGHT&quot;&quot;>&quot;
response.write&quot; </font></td>&quot;
response.write&quot; </tr>&quot;

totRec = 0

End If
lastCode = origCode
'*************************************************************************************

If origCode <> &quot;&quot; then

response.write&quot; <tr>&quot;
response.write&quot; <td WIDTH=&quot;&quot;65%&quot;&quot; HEIGHT=&quot;&quot;10&quot;&quot; bgcolor=&quot;&quot;#F1FFF0&quot;&quot;>&quot;
response.write&quot; <p ALIGN=&quot;&quot;LEFT&quot;&quot;><b><font face=&quot;&quot;Arial&quot;&quot; size=&quot;&quot;1&quot;&quot;>&quot;
response.write rs(&quot;DESCRIPTION&quot;)
response.write&quot;</font></b></td>&quot;

response.write&quot; <td WIDTH=&quot;&quot;20%&quot;&quot; HEIGHT=&quot;&quot;10&quot;&quot; bgcolor=&quot;&quot;#EFEFEF&quot;&quot; align=&quot;&quot;center&quot;&quot;><font FACE=&quot;&quot;Arial&quot;&quot; SIZE=&quot;&quot;1&quot;&quot;>&quot;
response.write&quot; <p ALIGN=&quot;&quot;RIGHT&quot;&quot;>&quot;
response.write formatNumber(rs(&quot;MONTH&quot;),0)
response.write&quot; </font></td>&quot;
'response.write&quot; </tr>&quot;


End If
'*************************************************************************************

lastTotRec = totRec
End If

v = rs(&quot;MONTH&quot;)
totRec = totRec + v

rs.MoveNext
cnt = cnt + 1
Loop
'*************************************************************************************

If origCode <> &quot;&quot; then

response.write&quot; <tr>&quot;
response.write&quot; <td WIDTH=&quot;&quot;65%&quot;&quot; HEIGHT=&quot;&quot;10&quot;&quot; bgcolor=&quot;&quot;#EFEFEF&quot;&quot;>&quot;
response.write&quot; <p ALIGN=&quot;&quot;LEFT&quot;&quot;><b><font face=&quot;&quot;Arial&quot;&quot; size=&quot;&quot;1&quot;&quot;>&quot;
response.write&quot;TOTAL - EOF&quot;
response.write&quot;</font></b></td>&quot;

response.write&quot; <td WIDTH=&quot;&quot;20%&quot;&quot; HEIGHT=&quot;&quot;10&quot;&quot; bgcolor=&quot;&quot;#EFEFEF&quot;&quot; align=&quot;&quot;center&quot;&quot;><font FACE=&quot;&quot;Arial&quot;&quot; SIZE=&quot;&quot;1&quot;&quot;>&quot;
response.write&quot; <p ALIGN=&quot;&quot;RIGHT&quot;&quot;>&quot;
response.write formatNumber(totRec,0)
response.write&quot; </font></td>&quot;
response.write&quot; </tr>&quot;

End If
'*************************************************************************************

RS.Close
Conn.Close
Set RS=Nothing
Set Conn=Nothing
%> Thanks,

Ricky Ombina
ombina@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top