Normal Topic program automatic late fee (Read 361 times)
MarkusK
Member
*
Offline



Posts: 2
Joined: Mar 9th, 2012
program automatic late fee
Jun 16th, 2012 at 4:20pm
Print Post Print Post  
I've been going crazy trying to program an automatic $5 late fee into a field if a certain date has passed and any amount still owed. Sounds simple, but isn't/doesn't work.

Any suggestions?

I've been trying:
if date paid ="" or date paid >@d(05/10/2012) and current dues paid <170 then late fee =5 else late fee =0
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: program automatic late fee
Reply #1 - Jun 16th, 2012 at 5:07pm
Print Post Print Post  
Your primary error is that the date string needs to have double quotes around it, like this:
Code
Select All
if date paid ="" or date paid >@d("05/10/2012") and current dues paid <170 then late fee =5 else late fee =0  



The only time you can omit those is if the date string is in the same format that Sesame uses internally, which is YYYY/MM/DD. So, this will also work:
Code
Select All
if date paid ="" or date paid >@d(2012/05/10) and current dues paid <170 then late fee =5 else late fee =0 



But, since you have 3 conditions mixed with "or" and "and", you should also be grouping two of them inside parentheses to ensure you are telling Sesame exactly what you want. So, depending on exactly what you intend, you may want to use something like the this:
Code
Select All
if (date paid ="" or date paid >@d("05/10/2012")) and current dues paid <170 then late fee =5 else late fee =0 


  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged