Normal Topic Programing Problem! (Read 797 times)
JJuarez
Member
*
Offline


No personal text

Posts: 26
Joined: Dec 15th, 2003
Programing Problem!
Jan 12th, 2004 at 10:55pm
Print Post Print Post  
I have a family database in Q&A that is working properly and have converted to Sesame. I have fields that calculate "years", "months", "days" and "total days".
The problem in Sesame is the "years" field keeps converting to a 4 digit number. Example: if the total should be  4 yrs 8 months 6 days since birth, I get something wild like 4085 yrs 8 months 6 days????
My formula is like following:
    TYEARS=@ABS(@INT((DateBorn-CurrentDate)/365.25))
Any suggestions??
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Programing Problem!
Reply #1 - Jan 12th, 2004 at 11:34pm
Print Post Print Post  
It looks to me like your formula is backwards. Try subtracting the DateBorn from the CurrentDate, not the other way around? Like so:
TYEARS = @ABS(@INT((CurrentDate - DateBorn) / 365.25))

Sesame's dates are actually dates, not strings pretending to be dates as in Q&A.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
JJuarez
Member
*
Offline


No personal text

Posts: 26
Joined: Dec 15th, 2003
Re: Programing Problem!
Reply #2 - Jan 13th, 2004 at 2:49pm
Print Post Print Post  
Thanks for your reply, it worked. Although in Q&A it is the formula is the other way around. I'm not a programmer, just like to think I can  Wink
  
Back to top
 
IP Logged