Hi,
Im trying to do the equivalent of this in stimulsoft, but the result is coming back as -36
SELECT datediff(n, '2002-11-06 10:30:00.00', '2002-11-11 13:06:00.000')
The result in SQL is 7356
I've used this in stimulsoft :
DateDiff(DataSource1.ClaimDate, DataSource1.DteLastSent).Minutes
ClaimDate is '2002-11-06 10:30:00.00' and DteLastSent is '2002-11-11 13:06:00.000'
Thanks
Datediff problem
-
- Posts: 20
- Joined: Fri Nov 20, 2009 7:40 am
Datediff problem
Hello,
We use following code for DateDiff function:
Unfortunately we can't change somthing now because this function is used in reports of our customers.
Thank you.
We use following code for DateDiff function:
Code: Select all
public static TimeSpan? DateDiff(DateTime? date1, DateTime? date2)
{
if (date1.HasValue && date2.HasValue)
return date1.Value.Subtract(date2.Value);
else
return null;
}
Thank you.
Datediff problem
Hi,
you can try the following:
This switches the order you pass in your date parameters and uses TotalMinutes instead of Minutes
you can try the following:
Code: Select all
{DateDiff(DataSource1.DteLastSent, DataSource1.ClaimDate).TotalMinutes}
-
- Posts: 20
- Joined: Fri Nov 20, 2009 7:40 am
Datediff problem
Thanks, the TotalMinutes option worked.