N
nadilieHLHL
I have this query thatès working fine:
SELECT Max(GI_ACTENREG_TB.DHREACT) AS MaxDeDHREACT, GI_ACTENREG_TB.DOSSIER
FROM [T-Gestion des usagers] INNER JOIN (GI_ACTENREG_TB INNER JOIN
GI_ACTIVITE_TB ON (GI_ACTENREG_TB.ACTCODE_OFFICIEL = GI_ACTIVITE_TB.ACTCODE)
AND (GI_ACTENREG_TB.UNITEADMCODE_FAIT = GI_ACTIVITE_TB.UNITEADMCODE) AND
(GI_ACTENREG_TB.CENACTIVCODE_FAIT = GI_ACTIVITE_TB.CENACTIVCODE)) ON
[T-Gestion des usagers].DOSIIERPATIENT = GI_ACTENREG_TB.DOSSIER
WHERE (((GI_ACTIVITE_TB.TYPEACT_MAISON_CODE)="D") AND
((GI_ACTENREG_TB.DHREACT) Between #4/1/2006# And #3/31/2007#) AND
((GI_ACTENREG_TB.INDICFAIT)<>0) AND ((GI_ACTENREG_TB.CENACTIVCODE_FAIT)=6332))
GROUP BY GI_ACTENREG_TB.DOSSIER
HAVING (((GI_ACTENREG_TB.DOSSIER)<"4000000"));
And I need to have the Max(GI_ACTENREG_TB.DHREACT) it's a date field to be
update in an another database.
UPDATE [T-TestChargementnomPrenom] INNER JOIN [R-Date dernier r-v
psychiatre] ON [T-TestChargementnomPrenom].DOSSIER = [R-Date dernier r-v
psychiatre].DOSSIER SET [T-TestChargementnomPrenom].dateHDernierRvMed =
"MaxDeDHREACT";
But I tried to save my first query and do an update query with but it says:
Operation must use an updateable query.
And then I tried this in SQL:
UPDATE S1 SET S1.dateHDernierRvMed = S2.DATEDERNIERRV
FROM [T-TestChargementnomPrenom] S1
INNER JOIN (
SELECT Max(GI_ACTENREG_TB.DHREACT) DATEDERNIERRV , GI_ACTENREG_TB.DOSSIER
FROM (
GI_ACTENREG_TB INNER JOIN GI_ACTIVITE_TB ON
(GI_ACTENREG_TB.CENACTIVCODE_FAIT = GI_ACTIVITE_TB.CENACTIVCODE) AND
(GI_ACTENREG_TB.UNITEADMCODE_FAIT = GI_ACTIVITE_TB.UNITEADMCODE) AND
(GI_ACTENREG_TB.ACTCODE_OFFICIEL = GI_ACTIVITE_TB.ACTCODE)) INNER JOIN
[T-TestChargementnomPrenom] ON GI_ACTENREG_TB.DOSSIER =
[T-TestChargementnomPrenom].DOSSIER
WHERE (((GI_ACTIVITE_TB.TYPEACT_MAISON_CODE)="D") AND
((GI_ACTENREG_TB.DHREACT) Between #4/1/2006# And #3/31/2007#) AND
((GI_ACTENREG_TB.INDICFAIT)<>0) AND ((GI_ACTENREG_TB.CENACTIVCODE_FAIT)=6332))
GROUP BY GI_ACTENREG_TB.DOSSIER
HAVING (((GI_ACTENREG_TB.DOSSIER)<"4000000"))) as S2
ON S1.DOSSIER = S2.DOSSIER
But it says syntax error (missing operator) in query expression...
and it highlight the very first FROM...
Any idea before I get crazy?
SELECT Max(GI_ACTENREG_TB.DHREACT) AS MaxDeDHREACT, GI_ACTENREG_TB.DOSSIER
FROM [T-Gestion des usagers] INNER JOIN (GI_ACTENREG_TB INNER JOIN
GI_ACTIVITE_TB ON (GI_ACTENREG_TB.ACTCODE_OFFICIEL = GI_ACTIVITE_TB.ACTCODE)
AND (GI_ACTENREG_TB.UNITEADMCODE_FAIT = GI_ACTIVITE_TB.UNITEADMCODE) AND
(GI_ACTENREG_TB.CENACTIVCODE_FAIT = GI_ACTIVITE_TB.CENACTIVCODE)) ON
[T-Gestion des usagers].DOSIIERPATIENT = GI_ACTENREG_TB.DOSSIER
WHERE (((GI_ACTIVITE_TB.TYPEACT_MAISON_CODE)="D") AND
((GI_ACTENREG_TB.DHREACT) Between #4/1/2006# And #3/31/2007#) AND
((GI_ACTENREG_TB.INDICFAIT)<>0) AND ((GI_ACTENREG_TB.CENACTIVCODE_FAIT)=6332))
GROUP BY GI_ACTENREG_TB.DOSSIER
HAVING (((GI_ACTENREG_TB.DOSSIER)<"4000000"));
And I need to have the Max(GI_ACTENREG_TB.DHREACT) it's a date field to be
update in an another database.
UPDATE [T-TestChargementnomPrenom] INNER JOIN [R-Date dernier r-v
psychiatre] ON [T-TestChargementnomPrenom].DOSSIER = [R-Date dernier r-v
psychiatre].DOSSIER SET [T-TestChargementnomPrenom].dateHDernierRvMed =
"MaxDeDHREACT";
But I tried to save my first query and do an update query with but it says:
Operation must use an updateable query.
And then I tried this in SQL:
UPDATE S1 SET S1.dateHDernierRvMed = S2.DATEDERNIERRV
FROM [T-TestChargementnomPrenom] S1
INNER JOIN (
SELECT Max(GI_ACTENREG_TB.DHREACT) DATEDERNIERRV , GI_ACTENREG_TB.DOSSIER
FROM (
GI_ACTENREG_TB INNER JOIN GI_ACTIVITE_TB ON
(GI_ACTENREG_TB.CENACTIVCODE_FAIT = GI_ACTIVITE_TB.CENACTIVCODE) AND
(GI_ACTENREG_TB.UNITEADMCODE_FAIT = GI_ACTIVITE_TB.UNITEADMCODE) AND
(GI_ACTENREG_TB.ACTCODE_OFFICIEL = GI_ACTIVITE_TB.ACTCODE)) INNER JOIN
[T-TestChargementnomPrenom] ON GI_ACTENREG_TB.DOSSIER =
[T-TestChargementnomPrenom].DOSSIER
WHERE (((GI_ACTIVITE_TB.TYPEACT_MAISON_CODE)="D") AND
((GI_ACTENREG_TB.DHREACT) Between #4/1/2006# And #3/31/2007#) AND
((GI_ACTENREG_TB.INDICFAIT)<>0) AND ((GI_ACTENREG_TB.CENACTIVCODE_FAIT)=6332))
GROUP BY GI_ACTENREG_TB.DOSSIER
HAVING (((GI_ACTENREG_TB.DOSSIER)<"4000000"))) as S2
ON S1.DOSSIER = S2.DOSSIER
But it says syntax error (missing operator) in query expression...
and it highlight the very first FROM...
Any idea before I get crazy?