8/23/2025 5:26:33 PM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
|
|
|
|
calculating a date using DateAdd
Posted: 30 Apr 08 11:55 AM
|
I need to add days onto a date variable. Using the DATEADD function I am passing it the value for the number of days in a variable. It doesn't appear to recognize the variable because the date values don't change when I execute the script.
My code is: If RsStartDate <> ClassStartDate Then intDifference = DateDiff("d",ClassStartDate,RsStartDate) BreakoutStartDate = DateAdd("d", intDifference, ClassStartDate) End If
I added a message box and the intDifference values are correct but the date doesn't change when the last line executes. Any ideas?
Thanks, |
|
|
|
Re: calculating a date using DateAdd
Posted: 30 Apr 08 1:31 PM
|
I may be mistaken but couldn't you just reduce your code from this:
If RsStartDate <> ClassStartDate Then intDifference = DateDiff("d",ClassStartDate,RsStartDate) BreakoutStartDate = DateAdd("d", intDifference, ClassStartDate) End If
to this:
BreakOutStartDate = RsStartDate
They both accomplish the same thing.
|
|
|
|
Re: calculating a date using DateAdd
Posted: 30 Apr 08 1:38 PM
|
I got it figured out Matt, I was half asleep when I was trying to get the new date value. The dates I am displaying are for scheduled training classes and I am calculating the new date to populate so users don't have to. If the current class is scheduled for a Tuesday but the course runs Monday - Friday I am displaying the starting date as the date that Tuesday falls on. I have it working and now I am writing the code to calculate the ending date for classes that end before the ending date of the course.
Thanks!!!!!! |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|