| Author |
Topic |
|
lucsky8
Posting Yak Master
105 Posts |
Posted - 2010-02-24 : 08:45:39
|
Hi, i have 2 tables-tblEleves-tblM2EvaluationElementReponseI need to select all the student event if they don't anything yet in the table tblM2EvaluationElementReponseSomething like this :SELECT te.intEleveId,te.strNom,te.strPrenom,ter.intEvaluationElementId,ter.strNoteFROM tblEleves as teleft JOIN tblM2EvaluationElementReponse as ter ON ter.intElevesId = te.intEleveIdWHERE ter.intEvaluationElementId = 680 ORDER BY ter.intEvaluationElementId,te.strPrenom Right now the query return nothing i want the query to return :intEleveId strNom strPrenom intEvaluationElementId strNote1 a b NULL NULL2 aa dd NULL NULLThe reason i want to do that because the result will be in a table in asp.net ans strNote will be a textbox and the user will enter a scoreI hope i exmplain my self right! |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-02-24 : 08:47:27
|
| what happens when you change WHERE to AND?MadhivananFailing to plan is Planning to fail |
 |
|
|
lucsky8
Posting Yak Master
105 Posts |
Posted - 2010-02-24 : 08:53:00
|
quote: Originally posted by madhivanan what happens when you change WHERE to AND?MadhivananFailing to plan is Planning to fail
Tks for the fast anwser i think it will work i will to change code a bit!Tks for the help! |
 |
|
|
DP978
Constraint Violating Yak Guru
269 Posts |
Posted - 2010-02-24 : 08:57:51
|
| How do you expect to get a null value for intEvaluationElementId when you explicitly state it needs to be 680?intEleveId strNom strPrenom intEvaluationElementId strNote1 a b NULL NULL2 aa dd NULL NULLEDIT: That May have been what Madiv was getting at... |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
DP978
Constraint Violating Yak Guru
269 Posts |
Posted - 2010-02-24 : 09:56:42
|
| Ah, thanks for the resource. I got confused a bit, appreciate the response. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-24 : 10:00:37
|
welcome ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
lucsky8
Posting Yak Master
105 Posts |
Posted - 2010-02-24 : 12:01:15
|
quote: Originally posted by DP978 How do you expect to get a null value for intEvaluationElementId when you explicitly state it needs to be 680?intEleveId strNom strPrenom intEvaluationElementId strNote1 a b NULL NULL2 aa dd NULL NULLEDIT: That May have been what Madiv was getting at...
i put 680 but for real this select is in a stored procedure with a variable |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-24 : 12:03:56
|
quote: Originally posted by lucsky8
quote: Originally posted by DP978 How do you expect to get a null value for intEvaluationElementId when you explicitly state it needs to be 680?intEleveId strNom strPrenom intEvaluationElementId strNote1 a b NULL NULL2 aa dd NULL NULLEDIT: That May have been what Madiv was getting at...
i put 680 but for real this select is in a stored procedure with a variable
so what? that doesnt change the solution. just make it like....left JOIN tblM2EvaluationElementReponse as ter ON ter.intElevesId = te.intEleveIdAND ter.intEvaluationElementId = @Yourvariable... ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
lucsky8
Posting Yak Master
105 Posts |
Posted - 2010-02-24 : 12:05:38
|
| no |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-24 : 12:06:57
|
quote: Originally posted by lucsky8 no
why??------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|