Click here to Skip to main content
15,893,266 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Select task_desp from Assign_taskk where due_date >= '6/26/216'
and
sup_id =
(Select sup_id from Approved_project where completion_status = 'In Progress'
AND
P_id = (Select P_id from student_proj_detail WHERE stnId = '1'))

What I have tried:

i have executed in sql server but not working
Posted
Updated 28-Jun-16 8:22am

1 solution

Simple: there are no matching rows.

Start with SSMS and try each part of the query. Start with just:
SQL
Select task_desp from Assign_taskk where due_date >= '6/26/216'
And see exactly what rows it returns.
Then, use those rows to check the second part as well. And then the final one.
I'm guessing that it's the date: SQL doesn't particularly like European dates, and prefers ISO: yyyy-MM-dd so it's possible that your date is just converting badly. It's also possible that you are storing dates in your DB as NVARCHAR or VARCHAR and that that is causing the problem.
We don't know - we don't have any access to your data, so we can't check. So you will have to do this one yourself!
(But I'd suspect that your database is a bit badly organised if you need two nested SELECTs just to handle the WHERE clause - I think a design that supported JOIN instead would be a lot easier to work with.)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900