DateDiff function

Stimulsoft Reports.NET discussion
Post Reply
Sandy Pham
Posts: 62
Joined: Mon Dec 11, 2006 1:43 pm
Location: U.S.A.

DateDiff function

Post by Sandy Pham »

In the report writer, how can I do a DateDiff?

For example, I want to show how old something is by doing DateDiff(Today, CreatedDateTime).

Thanks!

Sandy
Brendan
Posts: 309
Joined: Sun Jul 16, 2006 12:42 pm
Location: Ireland

DateDiff function

Post by Brendan »

The following post shows how it can be achieved using the VB compatibility assembly.

http://forum.stimulsoft.com/Default.aspx?g=posts&t=194

To accomplish the same with c# and the framework the following can be used

Code: Select all

{DateTime.Today.Subtract(CreatedDateTime).Days}
Subtract() will return a TimeSpan object and from that you can check for days, hours, minutes, etc.
Sandy Pham
Posts: 62
Joined: Mon Dec 11, 2006 1:43 pm
Location: U.S.A.

DateDiff function

Post by Sandy Pham »

Whew, that is a relief. My customer was really mad at me and lecturing me on how that should be an essential feature in any report writer. :sweat:

It would be really nice if these DateTime functions were listed as part of the system functions you provide in the GUI.

Thanks!

Sandy
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

DateDiff function

Post by Vital »

Sandy wrote:Whew, that is a relief. My customer was really mad at me and lecturing me on how that should be an essential feature in any report writer. :sweat:

It would be really nice if these DateTime functions were listed as part of the system functions you provide in the GUI.
Added. Please check build from 10 April.

Thank you.
jellis
Posts: 22
Joined: Wed Jun 27, 2007 5:28 am
Location: United Kingdom

DateDiff function

Post by jellis »

Hi,

I'm looking for the date functions in the expression builder (specifically DateDiff) and can't find them. Do I still need to use the long method listed in this thread, or can you tell me how to access them?

Regards,

Jon.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

DateDiff function

Post by Edward »

Hello, Jon.

In the prerelease builds started from April, 10th the DateDiff function is available:

Image

Thank you.
jellis
Posts: 22
Joined: Wed Jun 27, 2007 5:28 am
Location: United Kingdom

DateDiff function

Post by jellis »

thanks edward, I'll log in & get that build.
Post Reply