1 2 3 4
| SELECT Restaurant.[Centre de cout], Restaurant.[Nom du restaurant], Loyers.Loyer, Loyers.[Indice de base], Indice.[trimestre/Mois], Indice.Indice, Indice.[Indice N-1], Indice.[Indice N-2], Loyers.[ANNEE REVISION], Loyers.[type revision], Indice.Année, Indice.[Année N-1], Indice.[Année N-2], Indice.[Année N-3], IIf([annee revision]="N-1",[année N-1],indice.Année) AS [Année revise], IIf([ANNEE REVISION]="N-1",IIf([type revision]="triennal",[année N-3],[année N-1]),IIf([type revision]="triennal",[année N-2],[indice].[Année])) AS [Année révisés], IIf([ANNEE REVISION]="N-1",IIf([type revision]="triennal",IIf(Int(([indice].[année]-[loyers].[année])/3)*3+[loyers].[année]=[indice].[année],[indice].[année],IIf(Int(([indice].[année]-[loyers].[année])/3)*3+[loyers].[année]=[indice].[année N-1],[indice].[année N-1],[indice].[année N-2])),[année N-1]),IIf([type revision]="triennal",IIf(Int(([indice].[année]-[loyers].[année])/3)*3+[loyers].[année]=[indice].[année N-1],[indice].[année N-1],IIf(Int(([indice].[année]-[loyers].[année])/3)*3+[loyers].[année]=[indice].[année N-2],[indice].[année N-2],[indice].[année N-3])),[indice].[Année])) AS [Année à reviser], IIf([ANNEE REVISION]="N-1",IIf([type revision]="triennal",IIf(Int(([indice].[année]-[loyers].[année])/3)*3+[loyers].[année]=[indice].[année],[indice].[indice],IIf(Int(([indice].[année]-[loyers].[année])/3)*3+[loyers].[année]=[indice].[indice N-1],[indice].[indice N-1],[indice].[indice N-2])),[indice N-1]),IIf([type revision]="triennal",IIf(Int(([indice].[année]-[loyers].[année])/3)*3+[loyers].[année]=[indice].[année N-1],[indice].[indice N-1],IIf(Int(([indice].[année]-[loyers].[année])/3)*3+[loyers].[année]=[indice].[année N-2],[indice].[indice N-2],[indice].[indice N-3])),[indice].[indice]))*[loyer]/[indice de base] AS [Nouveau loyer], IIf([ANNEE REVISION]="N-1",IIf([type revision]="triennal",IIf(Int(([indice].[année]-[loyers].[année])/3-3)*3+[loyers].[année]=[indice].[année],[indice].[indice N-1],IIf(Int(([indice].[année]-[loyers].[année])/3-3)*3+[loyers].[année]=[indice].[indice N-1],[indice].[indice N-2],[indice].[indice N-3])),[indice N-2]),IIf([type revision]="triennal",IIf(Int(([indice].[année]-[loyers].[année])/3-3)*3+[loyers].[année]=[indice].[année N-1],[indice].[indice N-2],IIf(Int(([indice].[année]-[loyers].[année])/3-3)*3+[loyers].[année]=[indice].[année N-2],[indice].[indice N-3],[indice].[indice N-4])),[indice].[indice N-1]))*[loyer]/[indice de base] AS [Loyer N-1], [loyer N-1]-[loyer] AS a, IIf([a]<1,[loyer],[loyer N-1]) AS [Ancien loyer], IIf([loyers].[nom mois]=1,(31-[loyers].[jour]+1)*([nouveau loyer]/4)/90+([ancien loyer]/4)*([jour]-1)/90,[nouveau loyer]) AS janvier
FROM Bailleur INNER JOIN (Restaurant INNER JOIN (Loyers INNER JOIN Indice ON (Loyers.[Trimestre/Mois] = Indice.[trimestre/Mois]) AND (Loyers.[type indice] = Indice.[Type Indice])) ON Restaurant.[Centre de cout] = Loyers.[Centre de cout]) ON Bailleur.[Numero bailleur] = Loyers.[Numero bailleur]
GROUP BY Restaurant.[Centre de cout], Restaurant.[Nom du restaurant], Loyers.Loyer, Loyers.[Indice de base], Indice.[trimestre/Mois], Indice.Indice, Indice.[Indice N-1], Indice.[Indice N-2], Loyers.[ANNEE REVISION], Loyers.[type revision], Indice.Année, Indice.[Année N-1], Indice.[Année N-2], Indice.[Année N-3], IIf([annee revision]="N-1",[année N-1],indice.Année), IIf([ANNEE REVISION]="N-1",IIf([type revision]="triennal",[année N-3],[année N-1]),IIf([type revision]="triennal",[année N-2],[indice].[Année])), IIf([ANNEE REVISION]="N-1",IIf([type revision]="triennal",IIf(Int(([indice].[année]-[loyers].[année])/3)*3+[loyers].[année]=[indice].[année],[indice].[année],IIf(Int(([indice].[année]-[loyers].[année])/3)*3+[loyers].[année]=[indice].[année N-1],[indice].[année N-1],[indice].[année N-2])),[année N-1]),IIf([type revision]="triennal",IIf(Int(([indice].[année]-[loyers].[année])/3)*3+[loyers].[année]=[indice].[année N-1],[indice].[année N-1],IIf(Int(([indice].[année]-[loyers].[année])/3)*3+[loyers].[année]=[indice].[année N-2],[indice].[année N-2],[indice].[année N-3])),[indice].[Année])), IIf([ANNEE REVISION]="N-1",IIf([type revision]="triennal",IIf(Int(([indice].[année]-[loyers].[année])/3)*3+[loyers].[année]=[indice].[année],[indice].[indice],IIf(Int(([indice].[année]-[loyers].[année])/3)*3+[loyers].[année]=[indice].[indice N-1],[indice].[indice N-1],[indice].[indice N-2])),[indice N-1]),IIf([type revision]="triennal",IIf(Int(([indice].[année]-[loyers].[année])/3)*3+[loyers].[année]=[indice].[année N-1],[indice].[indice N-1],IIf(Int(([indice].[année]-[loyers].[année])/3)*3+[loyers].[année]=[indice].[année N-2],[indice].[indice N-2],[indice].[indice N-3])),[indice].[indice]))*[loyer]/[indice de base], IIf([ANNEE REVISION]="N-1",IIf([type revision]="triennal",IIf(Int(([indice].[année]-[loyers].[année])/3-3)*3+[loyers].[année]=[indice].[année],[indice].[indice N-1],IIf(Int(([indice].[année]-[loyers].[année])/3-3)*3+[loyers].[année]=[indice].[indice N-1],[indice].[indice N-2],[indice].[indice N-3])),[indice N-2]),IIf([type revision]="triennal",IIf(Int(([indice].[année]-[loyers].[année])/3-3)*3+[loyers].[année]=[indice].[année N-1],[indice].[indice N-2],IIf(Int(([indice].[année]-[loyers].[année])/3-3)*3+[loyers].[année]=[indice].[année N-2],[indice].[indice N-3],[indice].[indice N-4])),[indice].[indice N-1]))*[loyer]/[indice de base], [loyer N-1]-[loyer], IIf([a]<1,[loyer],[loyer N-1]), IIf([loyers].[nom mois]=1,(31-[loyers].[jour]+1)*([nouveau loyer]/4)/90+([ancien loyer]/4)*([jour]-1)/90,[nouveau loyer])
HAVING (((Indice.Année)=2006)); |
Partager