This is a migrated thread and some comments may be shown as answers.

Calculate past due date

9 Answers 499 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kent Hoang
Top achievements
Rank 1
Kent Hoang asked on 02 Sep 2009, 03:50 PM
in my DB, I have submit date & Due Date field.  I added a textbox & I try to calculate the past due date but it throw me an error
can someone help me with this?

= Fields.Date - Fields.[DueDate]  (I got error here)

9 Answers, 1 is accepted

Sort by
-1
Svetoslav
Telerik team
answered on 02 Sep 2009, 04:08 PM
Hello Kent Hoang,

Currently Telerik Reporting does not support date calculations. Anyway there are a couple of ways to workaround this limitation:
  • perform the calculations at the data source level. For example if the data comes from an SQL server you can subtract the dates in your SQL query;
  • a user-defined function that performs the date calculations. For more information please see Using Expressions.

Regards,
Svetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
1
Kent Hoang
Top achievements
Rank 1
answered on 02 Sep 2009, 04:15 PM
hmm, I'm trying to convert some of my Crystal Report to web base version.  My crystal reports have some advance calculation.  Date subtraction is just a simple thing & Telerik cannot do it?  It is so inconvenience.  You need to update your software please

Thanks
-1
Svetoslav
Telerik team
answered on 03 Sep 2009, 08:54 AM
Hello Kent Hoang,

Thank you for the feedback. Indeed this issue is already in our TODO list and it is just a matter of time when we will fix it. Until then it is best to stick with the suggested workarounds.

Regards,
Svetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Casey
Top achievements
Rank 1
answered on 14 Mar 2013, 09:31 PM
Has this issue been addressed? I'm trying to use ".AddDays" in one of my textboxes in the report, and it errors out. This would be a nice feature to have.

Thanks!
Casey
0
Peter
Telerik team
answered on 19 Mar 2013, 03:37 PM
Hello Casey,

DateTime.AddDays method is expecting argument of type double. Check out the following sample expression:
=CDate("2013-03-13").AddDays(CDbl(1))

All the best,
Peter
the Telerik team

Telerik Reporting Q1 2013 available for download with impressive new visualizations. Download today from your account.

0
Casey
Top achievements
Rank 1
answered on 19 Mar 2013, 03:42 PM
I have a DateTime property in my datasource. I'm trying to do MyDateTimeProperty.AddDays(MyDoubleProperty), and it isn't working.

I receive the following error:

"An error has occurred while processing TextBox 'textBox11': The expression contains undefined function call AddDays()."

Thanks!
Casey
0
Peter
Telerik team
answered on 20 Mar 2013, 01:44 PM
Hi Casey,

Try the following expression:

=CDate(MyDateTimeProperty).AddDays(CDbl(MyDoubleProperty))

Greetings,
Peter
the Telerik team

Telerik Reporting Q1 2013 available for download with impressive new visualizations. Download today from your account.

0
Casey
Top achievements
Rank 1
answered on 20 Mar 2013, 03:11 PM
Thanks Peter, this works. I was able to find it in the documentation too, now that I know what I should have been looking for... I wasn't aware that I would have to convert my DateTime object to a DateTime to use any of the DateTime methods.

Casey

0
Doors
Top achievements
Rank 2
Iron
answered on 16 Jun 2022, 05:01 PM
Since 2009 still there is no DATEDIFF Function there must be very long TODO list
Todor
Telerik team
commented on 21 Jun 2022, 07:29 AM

Hello Kerem,

You may subtract Dates and you will get the corresponding TimeSpan. For example, the following Expression returns the result '63.00:00:00':

= Date(2022, 10, 20) - Date(2022, 8, 18)

As another example, the next Expression will return the time of the current day:

= Now() - Today()

For more details, you may see the Date and Time functions we provide.

Tags
General Discussions
Asked by
Kent Hoang
Top achievements
Rank 1
Answers by
Svetoslav
Telerik team
Kent Hoang
Top achievements
Rank 1
Casey
Top achievements
Rank 1
Peter
Telerik team
Doors
Top achievements
Rank 2
Iron
Share this question
or