Custom field

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
christ2000
User
Posts: 519

Custom field

Post by christ2000 »

Hello, i am using the following expression i a custom field:

IF(IssuedDate IS NULL, 'No Record Found', IF(IFnull(ADDDATE(IssuedDate, INTERVAL ExpirationTime month),ValidUntil) IS NULL, 'N/A', IF(IFnull(DATEDIFF(ADDDATE(IssuedDate, INTERVAL ExpirationTIme month),NOW()),datediff(ValidUntil,Now()))>0,'Active','Expired')))

but i was trying to show also EXPIRING SOON , when the value is >15, but i can find a solution how add to this function.

any help on this? thanks


mobhar
User
Posts: 11727

Post by mobhar »

  1. What database are you using?
  2. Could you please post also the table schema including some records in it, so others could help you?

Thank you.


christ2000
User
Posts: 519

Post by christ2000 »

Hello i am using mysql

Table sample:

DocumentName Issued Date Valid Until Expirationtime Days Remaining Status (customfield)
Document 1 05/05/2019 06/30/2019 1 month 25 Active

keen in mind that the code show work, the problem is i want to show ExPIRING SOON when Days remaining is less than 15

now only show Active, when <0
N/A when issue date is null
Expired when days remaining is >0

maybe there is other way to show this in Custom field STATUS base on DaysRemaining field, not sure on this

thanks


mobhar
User
Posts: 11727

Post by mobhar »

Could you please re-post again your table schema including some records in it in .sql command, so we know the field type of each column in that table?


Post Reply