Hi every body,

I would like to declare variables in MS Query to use them several times thereafter.
Is this possible and if so what is the correct syntax because I get an error with the following one?
DECLARE @ANNEE int
SET @ANNEE= ?
SELECT
SMC.STE,
SMC.FAM_CLT,
SMC.SFAM_CLT,
SMC.CODE_CLT,
TC.NOM_CLIENT,
TC.DPT_GEO,
TC.VILLE_CLIENT,
TC.CODE_MULTIPROPRIETAIRE as CODE_MULTI,
TC.LIB_MULTIPROPRIETAIRE as MULTIPROPRIETAIRE,
TC.CODE_DCDR, TC.NOM_DECIDEUR, TC.TYPE_DCDR,
TC.RESEAU, TC.LIB_SECTEUR, SMC.CODE_GPE_ART,
/*SMC.ANNEE, SMC.MOIS, */
@ANNEE,
sum(SMC.QTE_FAC) as Qtes_UC,
sum(SMC.MONTANT_HT) as CA_YTD
FROM base.dbo.STAT_MARQUES_CLIENTS SMC
left join base.dbo.TABLE_CLIENTS TC
on SMC.CODE_CLT = TC.CODE_CLIENT AND SMC.STE = TC.SOCIETE
WHERE
SMC.ANNEE = @ANNEE
GROUP BY
SMC.STE,
SMC.FAM_CLT,
SMC.SFAM_CLT,
SMC.CODE_CLT,
TC.NOM_CLIENT,
TC.DPT_GEO,
TC.VILLE_CLIENT,
TC.CODE_MULTIPROPRIETAIRE,
TC.LIB_MULTIPROPRIETAIRE,
TC.CODE_DCDR,
TC.NOM_DECIDEUR,
TC.TYPE_DCDR,
TC.RESEAU,
TC.LIB_SECTEUR,
SMC.CODE_GPE_ART
Thanking you in advance for your help

Best regards

Philippe