473,322 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

trying to open more than one query

114 100+
Dear Friends,

I want to display a report based on multiple query. But I am not sure where is error mistake I am doing. Please help me out.........

Here is the code.....

[HTML]<%

DIM mySQL
mySQL = "SELECT * FROM eoi_test"

DIM totalrecords,numstatus_uc,numstatus_sl,numbranch,p er_short,per_underconsi

totalrecords = "SELECT count(*) FROM eoi_test"
numstatus_uc = "SELECT count(*) FROM eoi_test where status = 'Under Consideration'"

numstatus_sl = "SELECT count(*) FROM eoi_test where status = 'Shortlisted'"
numbranch = "SELECT count(*) FROM eoi_test where branch = 'ERO'"

per_short = (numstatus_sl/totalrecords)*100
per_underconsi = (numstatus_uc/totalrecords)*100

DIM objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open mySQL, con

if objRS.Recordcount = 0 then

response.write "No records found!"

else

%>

<table border="1" bordercolor="#000000" style="border-collapse:collapse" width="100%">
<tr>
<th>Branch</th><th>No of EOIs</th><th>Shortlisted or not</th><th>percentage shortlisted</th><th>Under Consideration</th><th>Percentage under consi</th></tr>

<% DO WHILE NOT objRS.EOF %>

<tr><td><% Response.Write objRS("branch") %></td>
<td><% Response.Write (numbranch) %></td>
<td><% Response.Write (numstatus_sl) %></td>
<td><% Response.Write (per_short) %></td>
<td><% Response.Write (numstatus_uc) %></td>
<td><% Response.Write (per_underconsi) %></td>
</tr>


<%
objRS.MoveNext
Loop
%>
</table>



<%

end if


objRS.Close
Set objRS = Nothing
con.Close
Set con = Nothing

%>[/HTML]


Your advice will be highly appreciated.......

Please help me to generate this report.

Thanks
Deepak
May 1 '07 #1
1 1109
Hello Deepak,

As far as i have understood ur coding, u are just writing sql query but not opening any recordset for those queries. U have just opend one record set for MYSQL but not for others. So open recordset for other query also then i hope there will not be any error.

Regards
SBansal
May 1 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Dave | last post by:
Has anyone encountered the error message "Can not open any more databases" and what did you do to solve it? Thanks, Dave
0
by: niTT | last post by:
Hi, I'm new to python, as in I read the first 5 chapters of 'dive into python' new. I'm trying to use the levenshtein algorithm to do some edit distance comparisions. However rather than...
3
by: Cagey | last post by:
What I'm trying for: If this selection or if click on selection (highlighted line choice/ which ever selection change) w/in query's combo dropdown list box (on Switchboard), then Open in...
1
lwwhite
by: lwwhite | last post by:
When a user clicks OK on form "SelectDefaults," I want to open form "Welcome" if the results of query "qry_todo_overdue" = 0 or form "OverdueToDo" if the results >= 1. First, I assume that I need to...
3
by: PGM | last post by:
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim Projname, ProjSpon As String Dim AppName, AppType, AppSupp, AppDesc As String...
14
by: akmaRudiliyn | last post by:
Hi Everybody.. This is my firstime in creating report using microsoft access. Actually i need to build a report based on a database call Table1. I only use 2 column of databse to put in my...
9
by: Bob Darlington | last post by:
The following query opens slowly the first time it is opened (6-7 seconds), but then is less than one second for the next random number of openings before slowing (6-7 seconds) again. SELECT...
9
by: sparks | last post by:
Right now I had to build a report that allowed the people to check for gross outliers in their data input. short I am looking at 2.5* std dev + - anyway I used 2 dummy variables in the query the...
6
by: tedpottel | last post by:
Hi, I have the following code <?php //DatabaseConnect(); if (!($dblink = mysql_connect("drt- sport.com","drtspo_tedted","oreo8157"))) die(" could not connect to mysal"); if (!$dbconn =...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.