Link to home
Create AccountLog in
Avatar of Yannie
Yannie

asked on

How to exit from the loop?

Dear alll...I have a reallly really really easy qn for u...
I'm just quite stuck for the moment...brain celll dead.

How do I exit just and print "no records found"?
Under the condition, DateDiff("d", DateInput, date()) > 90
If no files found for this, where do I print it?
Do I need to add extra If loops in it?

Please assist with some codes
Thank you.

If Not rs.Eof Then
		
	While Not rs.EOF
		DateInput = rs("DateInput")
		sName = rs("NAME")
		
				If DateDiff("d", DateInput, date()) > 90 Then
				counter = counter + 1
				If Not rs.EOF Then
				Response.Write(counter&"<br>")
				Response.Write(sName&"<br>")						Response.Write(rs_ncreport_red("Remark")&"<br>")
				Else
				' dates equal or more than 90 days
				End If
		
	rs.MoveNext
	WEnd
			
Else
 
End If

Open in new window

Avatar of hielo
hielo
Flag of Wallis and Futuna image

Not clear what you are trying to do there but to exit a while what you need is:
Exit While
ASKER CERTIFIED SOLUTION
Avatar of ee_rlee
ee_rlee
Flag of Philippines image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account