Brewser Posted January 3, 2007 Posted January 3, 2007 (edited) I need to add an expiration date so I created a global field that will take today's date and add 15 days. This is the expiration date. The problem I have is with certain days of the month. When I compare get(CurrentDate) to the set date +15 It thinks it's expired if it's installed on those days. Strangly this only happens on certain dates. My script looks this: Set Field [install_Date;Get(CurrentDate)+15] If [Get(CurrentDate) > Install_Date] Show Custom Dialog End program The problem is that this will not work if the install dates are on 2,3,4,5,6,7,8,9 but will work for all the other days of the month. Why is this so strange? It fails if you put in those dates in the month but not the others. Thanks for any help on this. Edited January 3, 2007 by Guest
Raybaudi Posted January 4, 2007 Posted January 4, 2007 Hi that script can't work ! If: Install_Date = Get (CurrentDate) + 15 Get (CurrentDate) will be ALWAYS < Install_Date ! Get (CurrentDate) = Install_Date - 15
comment Posted January 4, 2007 Posted January 4, 2007 Could it be that Install_Date is actually a TEXT field?
Raybaudi Posted January 4, 2007 Posted January 4, 2007 (edited) Try something like this: If [ IsEmpty (Expiration_Date )] Set Field [Expiration_Date ; Get( CurrentDate )+15] Else If [Get( CurrentDate ) > Expiration_Date] Show Custom Dialog End If Edited January 4, 2007 by Guest Logical correction: Expiration_Date is better !
Brewser Posted January 4, 2007 Author Posted January 4, 2007 OMG do I feel stupid. Yes it was a text field. It now works perfectly. Only took me 4 hours of testing before taking 2 min. to post on this site and got the answer quickly.
Recommended Posts
This topic is 6535 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now