0

i am working on a java project,
one of its web pages includes this query:-

select pname,age,gender,dscrptn from patient where curdate='05-17-2011' and docref='arshdeep' and meet='no'

but it is not working, i executed this in MS SQL,
BUT ITS SHOWING ONLY THE COLUMN NAMES THERE.
i.e
pname age gender dscrptn

please help, please........

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by BitBlt
0

doesn't matters, i havent selected that column with date data type, i have used varchar(50) for that, as i dnt need to manipulate date in any way.....

0

Usually it just means that there are no rows with all of the matching criteria. I suggest you try execute the query three times, each time including only ONE of the criteria in the "where" clause.

-- execution 1
select pname, age, gender, dscrptn 
from patient 
where 
curdate='05-17-2011'
--docref='arshdeep'
--meet='no'

-- execution 2
select pname, age, gender, dscrptn 
from patient 
where 
--curdate='05-17-2011'
docref='arshdeep'
--and meet='no'

-- execution 3
select pname, age, gender, dscrptn 
from patient 
where 
--curdate='05-17-2011'
--docref='arshdeep'
meet='no'

That will help isolate what part of the query is having an issue (if any). If you get data returned, that means there is data for that particular criterion. Then start using the criteria in pairs, you can determine which combination causes you to not get data returned. It may just be that no rows match your criteria, and there's no real problem with the query.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.