Author |
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: December 04 2007 at 09:09 | IP Logged
|
|
|
Help ! What is wrong with this?
IF (mid(["LOCAL1]" ,{CID_POS} + 3,2) < day(today()), "NEXT", "END")
If I substitute a “3” for day(today()) it works fine. LOCAL1 contains 30. When I test the formula in Formula Builder I get an !. If I run this:
ph_usermessage(mid("[LOCAL1]" ,{CID_POS} + 3,2) + "|" + DAY(TODAY()))
I get back what I would expect 30| 3
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: December 04 2007 at 10:17 | IP Logged
|
|
|
Pete,
Two problems (at least in the listing above, one may just be a typo).
The first one (possible typo):
(mid(["LOCA
The " needs to be on the outside of the [ in order for the variable to be substituted properly.
The second one is you're comparing a string to an integer in your IF statement. The day() function returns an integer, the mid() function returns a string. Below is what worked for me:
Code:
if(integer(mid("[LOCAL1]",{CID_POS} + 3,2)) < day(today()), "NEXT", "END") |
|
|
HTH,
Dave.
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: December 04 2007 at 10:29 | IP Logged
|
|
|
Thanks Dave.. Yes the first was a typo and I thought the problem was a mismatch on the type of data BUT I had not thought of using an integer.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|