hi..i m selecting company by datewise and displaying it..
but problem is for some date..it print exactly duplicate of existing records..means each company it print twice..
below is my code..
but problem is for some date..it print exactly duplicate of existing records..means each company it print twice..
below is my code..
asp Code:
|
<% if trim(Request.Form("sday")) = "" then from_date = trim(Request.QueryString("from_date")) end if to_date =emonth&"/"&eday&"/"&eyear to_date = to_date if trim(Request.Form("eday")) = "" then to_date = trim(Request.QueryString("to_date")) end if [COLOR=DarkRed]oRecComp.Open "Select company_master.company_id, company_master.company_name, company_master.record_date, company_master.approved from company_master, company_branch where (company_master.company_id=company_branch.company_ id) and (company_master.record_date between '"& from_date &"' and '"& to_date &"') and (company_master.approved is null or company_master.approved = 0) order by company_master.record_date, company_master.company_name ",oConn,adOpenKeyset[/COLOR] %> <body> <table width="80%" border="0" cellpadding="3" align="center" class="bdlinks"> <form name="f1" action="comp_alpha5.asp" method="post" > <tr><td><a href="#" onClick="dubey(true)">Checked All</a> <a href="#" onClick="dubey(false)">Unchecked All</a></td></tr> <tr bgcolor="#E4E4E4" class="N"> <td align="left" width="10%"> <% while not oRecComp.EOF for i = 1 to oReccomp.recordcount response.write "<tr><td bgcolor=""#E4E4E4"" width=""100%"" ><input type=""checkbox"" name=""c1"" value=" & oRecComp("Company_id")& " ><font size=""1"">" & oRecComp("Company_name") & "</font></td><td bgcolor=""#E4E4E4"" >"&i&"</td></tr>" oRecComp.MoveNext next wend oReccomp.close set oReccomp=nothing oConn.close set oConn=nothing %>


