Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Banner code problem
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

endomorph
Junior Member

United Kingdom
128 Posts

Posted - 23 March 2005 :  12:20:05  Show Profile
I have a problem with some banner code I am trying to install. Unfortunatly the code is not supported by the author anymore.

When I go to generate a report of impressions and clicks, instead of showing each banner once, it shows it about 5 times in a long list.

Below is the code from the asp page that generates the output.

Can nayone see anything obviously wrong ?

Cheers

if request.form("func") = "Generate" then
		reportDate = request.form("reportDate")
		banner = request.form("banner")
		
		sql = "select logs.bannerID, logs.logDate, banners.bannerName, banners.imp, banners.clicks from logs "
		sql = sql & " INNER JOIN banners on banners.bannerID = logs.bannerID "
		
		
		sql = sql & " where "

		select case reportDate
		case "Today"
		sql = sql & "datediff(""d"", logDate, Date()) = 0 "

		case "Yesterday"
		sql = sql & "datediff(""d"", logDate, Date()) = 1 "
		
		case "Last 7 Days"
		sql = sql & "datediff(""d"", logDate, Date()) <= 7 "

		case "Current Month"
		sql = sql & "Month(logDate) = month(Date()) "

		case "Last Month"
		sql = sql & "datediff(""m"", logDate, Date()) = 1 "
		end select

		if NOT banner = "All Banners" then
		sql = sql & " AND logs.bannerID = " & banner
		end if
		
		sql = sql & " order by logDate desc"
				set cn = server.createobject("adodb.connection")
				cn.open strCon
				set rs = cn.execute(sql)
				
				do while not rs.eof
				response.write "<b><a href=""edit.asp?bannerID=" & rs("bannerID") & """>" &  rs("bannerName") 

& "</a></b><br>"
				response.write "Date : " & formatDateTime(rs("logDate"), 1) & "<br>"
				response.write "Imp : " & rs("imp") & "<br>"
				response.write "Clicks : " & rs("clicks") & "<br><br>"
				rs.movenext
	loop			

	end if

Need help with your Snitz ? Most Snitz & ASP custom coding undertaken. Email for info | Search Engine Optimisation
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.38 seconds. Powered By: Snitz Forums 2000 Version 3.4.07