Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, August 23, 2025 
 
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!
 Architect Forums - SalesLogix Scripting & Customization
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.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: calculating a date using DateAdd
Bill
Posts: 71
 
calculating a date using DateAddYour last visit to this thread was on 1/1/1970 12:00:00 AM
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,
[Reply][Quote]
Matt Dockins
Posts: 159
 
Re: calculating a date using DateAddYour last visit to this thread was on 1/1/1970 12:00:00 AM
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.
[Reply][Quote]
Bill
Posts: 71
 
Re: calculating a date using DateAddYour last visit to this thread was on 1/1/1970 12:00:00 AM
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!!!!!!
[Reply][Quote]
 Page 1 of 1 
  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!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 8/23/2025 2:20:41 PM