Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Day(Today()) Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: December 04 2007 at 09:09 | IP Logged Quote BeachBum

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 View BeachBum's Profile Search for other posts by BeachBum
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: December 04 2007 at 10:17 | IP Logged Quote dhoward

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 View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: December 04 2007 at 10:29 | IP Logged Quote BeachBum

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 View BeachBum's Profile Search for other posts by BeachBum
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum