Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone
I have Items table with Expiry Date. I want, Count of items whose expiry is in next 30 days.
EDITED
and maybe add an >= part:
Count({<ExpiryDate={"<=$(=date(addMonths(today(1),1),'The format of ur ExpiryDate field'))>=$(=Date(today(),'The format of ur ExpiryDate field'))"}>}distinct Items)
otherwise it will take all the ExpiryDates even those < today, so it will no longer be on (next 30 days)
Maybe sthing like :
Translate: count distinct items which expiryDate <= today + 1 month
count({<ExpiryDate={"<=$(=date(addMonths(today(1),1),'The format of ur ExpiryDate field')"}>}distinct Items)
I think you missed a closing parenthesis
Count({<ExpiryDate={"<=$(=date(addMonths(today(1),1),'The format of ur ExpiryDate field'))"}>}distinct Items)
Yes, my bad ! that because I've added the date() in the last minute
Make sense
Hi Omar and Sunny
Thanks for your response
This is not giving the exact result. This showing all upcoming expiry.
I have attached sample for you.
EDITED
and maybe add an >= part:
Count({<ExpiryDate={"<=$(=date(addMonths(today(1),1),'The format of ur ExpiryDate field'))>=$(=Date(today(),'The format of ur ExpiryDate field'))"}>}distinct Items)
otherwise it will take all the ExpiryDates even those < today, so it will no longer be on (next 30 days)
I think youssefbelloum got it right... this is giving 8
Count({<ExpiryDate={">=$(=Date(today(),'MM/DD/YYYY'))<=$(=date(addMonths(today(1),1),'MM/DD/YYYY'))"}>} ItemCode)
Thanks to all for the support
Count({<ExpiryDate={"<=$(=date(addMonths(today(1),1),'MM/DD/YYYY'))>=$(=date(today(1),'MM/DD/YYYY'))"}>} ItemCode)