CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> CodeCharge Studio -> ASP.NET - InMotion Framework

 Date Calculating Functions

Print topic Send  topic

Author Message

Posts: 67
Posted: 04/27/2009, 9:40 AM

I need to calculate a date field for an C# INMOTION project. The standard coding does not work, and Inmotion is not documented at all.

Here is what I would need:

When a registration field is completed, it should automatically calculate an expiration date based on Current Date + 30 Days.

I have tried:
Corporate_Addresses.GetControl<MTTextBox>("Plan_Expiration").Text = DateTime.Now.ToString() + 30;

I dont get an error, but the default value is displayed as "4/25/2009 8:11:21 PM30"

Anyhelp is much appreciated.

View profile  Send private message

Posts: 8
Posted: 04/27/2009, 10:30 AM

Hi Christoph,

You are concatenating strings instead of adding days. To add days you may use something like:

theNewDate = DateTime.Now.AddDays(30);

In your example:

Corporate_Addresses.GetControl<MTTextBox>("Plan_Expiration").Text = DateTime.Now.AddDays(30).ToString();

If you want your new date not to fall in a holiday, you may also use something like:

while (theNewDate.DayOfWeek == DayOfWeek.Saturday || theNewDate.DayOfWeek == DayOfWeek.Sunday) {


View profile  Send private message

Posts: 67
Posted: 05/04/2009, 9:59 AM

Thank you so much, Victor.

It worked great.

View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.