jeffer Posted August 26, 2003 Posted August 26, 2003 Hi, I have a date field (type:date name:currentdate) with a date in it (what a suprise:) Now I only want to change the month with a script. So I have been busy writing some scripts that searches in the datefield to the current monthnumber and replace it with an increment value like 1. So when the month is 8, it replaces it with 9. But it seems that there is something terribly wrong with this set field calc...maybe someone wants to take a look on it? Replace(currentdate, Position(currentdate, "-", "1", 1), "2", CurrentMonthNumber + 1) any help is welcome:) greetz, Jeffer
djgogi Posted August 26, 2003 Posted August 26, 2003 Try Date(Month(currentdate)+1, Day(currentdate), Year(currentdate))-(Day(currentdate) <> Day(Date(Month(currentdate)+1, Day(currentdate), Year(currentdate)))) Dj
djgogi Posted August 26, 2003 Posted August 26, 2003 hi Lee, In case of date 08-31-2003, for example, this would produce 10-01-2003. That's why I've added the day check in formula. Dj
Lee Smith Posted August 26, 2003 Posted August 26, 2003 You are correct of course. I was zeroing in on the month. That will teach me to answer any questions until I have my second cup of coffee. Hey, there is a good idea for an Icon (Coffee Cup). One cup with a line through it represents no coffee yet, beware of the answer. One Cup no line would indicate person may be awake, but some caution should be taken in using answers. Two Cups would indicate that the person should be hitting on all cylinders now, advice can be look at as reliable.
jeffer Posted August 26, 2003 Author Posted August 26, 2003 Hi guys...thnx for the reply's! I was looking in the complete wrong direction:( greetz, jeffer ps. like the coffee cup idea;)
Recommended Posts
This topic is 7763 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now