Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good morning people! i'm having a problem with the following script,
its only giving me data from the 0-1 year line and is ignoring the rest.
if(today()-Due_Date>=0 or Today()-Due_Date<=365,'0-1 Years',
if(today()-Due_Date>=366 or Today()-Due_Date<=730,'1-2 Years',
if(today()-Due_Date>=731 or Today()-Due_Date<=1096,'2-3 Years',
if(today()-Due_Date>=1097 or Today()-Due_Date<=1461,'3-4 Years',
if(today()-Due_Date>=1462,'4+ Years'))))) as Years
Any ideas why this is doing this?
Kind Regards.
Paul.
Hi,
You should use and condition instead of or condition here both to be satisfied.
if(today()-Due_Date>=0 and Today()-Due_Date<=365,'0-1 Years',
if(today()-Due_Date>=366 and Today()-Due_Date<=730,'1-2 Years',
if(today()-Due_Date>=731 and Today()-Due_Date<=1096,'2-3 Years',
if(today()-Due_Date>=1097 and Today()-Due_Date<=1461,'3-4 Years',
if(today()-Due_Date>=1462,'4+ Years'))))) as Years
Hope it helps
Celambarasan
Hi,
You should use and condition instead of or condition here both to be satisfied.
if(today()-Due_Date>=0 and Today()-Due_Date<=365,'0-1 Years',
if(today()-Due_Date>=366 and Today()-Due_Date<=730,'1-2 Years',
if(today()-Due_Date>=731 and Today()-Due_Date<=1096,'2-3 Years',
if(today()-Due_Date>=1097 and Today()-Due_Date<=1461,'3-4 Years',
if(today()-Due_Date>=1462,'4+ Years'))))) as Years
Hope it helps
Celambarasan
Hi,
Use AND instead of OR in the If statement.
Regards,
Jagan.
Thankyou! Much appreciated!