INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Please help with this DB Expression!  (Read 749 times)

risingdamp

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 419
Please help with this DB Expression!
« on: June 25, 2005, 03:32:41 am »

I have a custom field called Decade and I want to write a DB expression that will tell me if the decade is wrong based on the value of Date(year).  It will simply establish if the first character of Decade is the same as the third character of Date(year) e.g.:

Decade = 60s
Date(year) = 1965

...would be OK and this would not be OK

Decade = 80s
Date(year) = 1995

I feel this could be done with a combination of FormatBoolean, IsEqual and Mid but there's just too much nesting for me to work it out.  Can someone help?
Logged
JLee

risingdamp

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 419
Re: Please help with this DB Expression!
« Reply #1 on: June 25, 2005, 05:28:59 am »

Well I managed it eventually  :D

Code: [Select]
If(IsEqual(Mid([Decade],0,1),Mid([Date (Year)],2,1),1),Decade Ok,Decade Wrong)
Of course this won't work where the decade should be 2000+ where the Date (Year) begins with a 2 so I just need a separate VS for that.
Logged
JLee
Pages: [1]   Go Up