Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Table INNER JOIN big thoughie question!

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-11-13 : 11:17:50
Angela writes "Hi,

I've got this request in ACCESS, in order to display everuy information about a project number :
SELECT DISTINCT T1.Priorite,T2.Responsable, T3.DateMiseEnService, T1.NoProjet, tblRegion.Nom_Region, tblRegion.Indicatif
FROM tblRegion, (" +Session("table_globale")+" AS T1
INNER JOIN " +Session("table_globale")+" AS T2
ON T1.NoProjet = T2.NoProjet)
INNER JOIN " +Session("table_globale")+" AS T3
ON T2.NoProjet=T3.NoProjet
WHERE ( ((T1.Priorite)<>'')
AND ((T2.Succal)<>'')
AND ((T3.DateMiseEnService) Is Not Null)
AND (Nom_Region=T1.Region))


My ACCESS table looks like this :

NoProjet    Responsable   Budget   Priorite  DateMiseEnService
F30000          Aaaaaa       
F30000          Aaaaaa       15$
F30000          Aaaaaa                1
F30000          Aaaaaa                     00/12/12
With my SQL statement, I can search all I need and put it in one record....

Example :
NoProjet    Responsable   Budget   Priorite  DateMiseEnService
F30000 Aaaaaa 15$ 1 00/12/12
BUT!
the problem is I have some exceptionnal project properties like this :

NoProjet    Responsable   Budget   Priorite  DateMiseEnService
F30000          Aaaaaa    
F30000          Aaaaaa     15$
F30000          Aaaaaa            1
F30000          Aaaaaa                    00/12/12
F30000          Bbbbbb      40$
F30000          Bbbbbb              3 00/01/01
How can I modify my SQL statement so I can get only the 1st project propoerties????
I mean here, here's the result I expect,no matter how much other "responsable" fields different than the first encountered in that project number :

NoProjet    Responsable   Budget   Priorite  DateMiseEnService
F30000          Aaaaaa         15$         1         00/12/12
And here's what my SQL query currently returns :
NoProjet    Responsable   Budget   Priorite  DateMiseEnService
F30000          Aaaaaa        15$        1        00/12/12
F30000          Bbbbbb        40$        3        00/01/01
I do not want a duplicate of the project number. How do I do that?
It sure is a thoughie!

Archangel"
   

- Advertisement -