简体   繁体   中英

MS Access IIF Query if Date

I'm trying to create an access query based on the date field, the query i Have which runs but doesn't populate the correct information is as follows

IIf([Last Pyt Date]>DateAdd("d",-60,Date()),'Arrangement in place'))

the "Last Pyt Date" needs to be within the last 60 days to populate "Arrangement in place" otherwise I will specify different information to populate if the day of Last Pyt is older than 60 days.

您可能想要反转您的逻辑以匹配您的描述

IIf( Date() < DateAdd("d", 60, [Last Pyt Date]), 'Arrangement in place')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM