Solved

Before start of result set ???

Posted on 2002-04-10
8
296 Views
Last Modified: 2008-02-26
I have this sql which i hope is correct but when i tried to use count1, i keep getting this error. Before start of result set even though i did result1.next();

"SELECT custM_ID,custF_ID,date,count(dateID) as count1 from date_particular group by custM_ID,custF_ID having (count(custM_ID) = "+j+" or count(custF_ID) = "+j+") and month(date) = '"+request.getParameter("MONTH")+"' and year(date) = '"+request.getParameter("YR")+"'"
0
Comment
Question by:yan_er04
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 6933754
can you post your entire code.. and point out where the error is?
0
 
LVL 2

Assisted Solution

by:coreyit
coreyit earned 25 total points
ID: 6934386
Try outputing the boolean returned by result1.next() to see if you actually received anything.

-corey
0
 
LVL 92

Accepted Solution

by:
objects earned 25 total points
ID: 6941015
I'd say your query is returning no rows.
Check your query returns something.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:coreyit
ID: 6942823
Checking the boolean value returned by ResultSet.next(), or, better, ResultSet.first(), should be sufficiently indicate whether or not you have any results.

-corey
0
 
LVL 92

Expert Comment

by:objects
ID: 6943354
I was suggesting running the query directly on the database, not thru Java. The problem may be in their construction of the query in Java.
0
 
LVL 2

Expert Comment

by:coreyit
ID: 6943429
good point
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 9553217
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split between objects and coreyit.  
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Kuldeepchaturvedi
EE Cleanup Volunteer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Configuring Remote Assistance for use with SCCM
By reading this blog, MSPs will gain insight into how to improve communications with their clients as well as establish a more profitable business.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question