1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| SELECT dbo_ARTICLES.COD_ART, dbo_ARTICLES.DGN, dbo_ARTICLES.DEB_TRF_1, dbo_ARTICLES.PRX_VEN_HT_1, dbo_ARTICLES.DEB_TRF_2, dbo_ARTICLES.PRX_VEN_HT_2, (Now()) AS DATEJOUR,
iif(
isdate(RIGHT([DEB_TRF_1],2) & "/" & Mid([DEB_TRF_1],5,2) & "/" & LEFT([DEB_TRF_1],4)),
CDate(RIGHT([DEB_TRF_1],2) & "/" & Mid([DEB_TRF_1],5,2) & "/" & LEFT([DEB_TRF_1],4)),""
) AS DEB1,
iif(
isdate(RIGHT([DEB_TRF_2],2) & "/" & Mid([DEB_TRF_2],5,2) & "/" & LEFT([DEB_TRF_2],4)),
CDate(RIGHT([DEB_TRF_2],2) & "/" & Mid([DEB_TRF_2],5,2) & "/" & LEFT([DEB_TRF_2],4)),
) AS DEB2,
IIf(Format(Now(),"dd/mm/yyyy")<=Format(DEB1,"dd/mm/yyyy"),PRX_VEN_HT_1,PRX_VEN_HT_2) AS test,
Format(DEB1,"dd/mm/yyyy") As DEB1FORMAT,
Format(DEB2,"dd/mm/yyyy") As DEB2FORMAT,
Format(Now(),"dd/mm/yyyy") AS NOWFORMAT,
Switch(
[NOWFORMAT]>[DEB1FORMAT] AND [NOWFORMAT]>=[DEB2FORMAT],[DEB2FORMAT],
[NOWFORMAT]>=[DEB1FORMAT] AND [NOWFORMAT]<[DEB2FORMAT],[DEB1FORMAT],
[NOWFORMAT]>=[DEB1FORMAT] AND [DEB2FORMAT] IS NULL,"VIDE en D2"
) AS Expr1
FROM dbo_ARTICLES
ORDER BY dbo_ARTICLES.COD_ART; |
Partager