Přidat otázku mezi oblíbenéZasílat nové odpovědi e-mailemVyřešeno LEFT JOIN v Accessu

Tento dotaz mi v MS SQL funguje správně:
SELECT GU2C.CPID AS CPID, E.CPID AS ECPID, E.EID AS EID, E.TOTALSTUDYTIME AS STUDY_LENGTH, E.ABSOLVED AS STATUS, E.ENDLEARN AS ABSOLVATION_DATE, TR.TID AS TID, TR.ATTEMPT AS ATTEMPT, TR.SCORE AS RESULT, TR.MINSCORE AS MINSCORE, TR.MAXSCORE AS MAXSCORE, TR.CREATED AS DATE_WHEN_ABSOLVATED_TEST, E.TIME_IN_COURSE AS TIME_IN_COURSE, E.LAST_OPENED AS LAST_OPENED, E.PRINTCOUNT AS PRINTCOUNT, E.LASTPRINT AS LASTPRINT, GU2C.VALIDFROM AS VALIDFROM, GU2C.VALIDTO AS VALIDTO
FROM GU2C
LEFT JOIN ENROLLMENTS AS E ON (E.CPID = GU2C.CPID AND E.USRID = 1)
LEFT JOIN TESTRESULTS AS TR ON (E.CPID = TR.CPID AND E.USRID = TR.USRID)
LEFT JOIN NOMINATION AS N ON N.CPID = GU2C.CPID AND N.USRID = 1
LEFT JOIN TERMS AS TM ON N.TERMID = TM.TERMID
WHERE (GU2C.USRID = 1)

Access však při pokusu o spuštění tohoto dotazu vypíše:
Syntax error (missing operator) in query expression
'(E.CPID = GU2C.CPID AND E.USRID = 1)
LEFT JOIN TESTRESULTS AS TR ON (E.CPID = TR.CPID AND E.USRID = TR.USRID)
LEFT JOIN NOMINATIONS AS N ON N.CPID = GU2C.CPID AND N.USRID = 1
LEFT JOIN TERMS AS TM ON N.TERMID = TM.TERMID'.

Poraďte prosím někdo jak to napsat tak, aby to fungovalo v Accessu (a pokud možno i v MS SQL)

Dík

Předmět Autor Datum
Tak už jsem na to přišla. Access vyžaduje přidání závorek: SELECT GU2C.CPID AS CPID, E.CPID AS ECPID… poslední
Anicka 21.04.2006 18:40
Anicka

Tak už jsem na to přišla. Access vyžaduje přidání závorek:
SELECT GU2C.CPID AS CPID, E.CPID AS ECPID, E.EID AS EID, E.TOTALSTUDYTIME AS STUDY_LENGTH, E.ABSOLVED AS STATUS, E.ENDLEARN AS ABSOLVATION_DATE, TR.TID AS TID, TR.ATTEMPT AS ATTEMPT, TR.SCORE AS RESULT, TR.MINSCORE AS MINSCORE, TR.MAXSCORE AS MAXSCORE, TR.CREATED AS DATE_WHEN_ABSOLVATED_TEST, E.TIME_IN_COURSE AS TIME_IN_COURSE, E.LAST_OPENED AS LAST_OPENED, E.PRINTCOUNT AS PRINTCOUNT, E.LASTPRINT AS LASTPRINT, GU2C.VALIDFROM AS VALIDFROM, GU2C.VALIDTO AS VALIDTO
FROM (((GU2C LEFT JOIN ENROLLMENTS AS E ON (E.CPID = GU2C.CPID AND E.USRID = 1))
LEFT JOIN TESTRESULTS AS TR ON (E.CPID = TR.CPID AND E.USRID = TR.USRID))
LEFT JOIN NOMINATION AS N ON (N.CPID = GU2C.CPID AND N.USRID = 1))
LEFT JOIN TERMS AS TM ON N.TERMID = TM.TERMID
WHERE (GU2C.USRID = 1)

a tohle funguje jak v Accessu, tak i v MS SQL

Zpět do poradny Odpovědět na původní otázku Nahoru