I am having textboxes on two detail rows (as an example), I want to calculate the date difference between two textbox date values. The date difference is between the previous row and the current row. As an example:
A B
5/2/2005 09:39:02 AM | 5/3/2005 06:29:32 PM |
5/4/2005 08:21:31 AM | 5/5/2005 07:02:29 PM |
5/6/2005 09:52:33 AM | 5/6/2005 07:04:31 PM |
5/7/2005 09:20:33 AM | 5/8/2005 08:26:36 AM |
I want to do A2-B1 in the report. I need to calculate the date difference between 5/4/2005 8:21:31 AM and 5/3/2005 6:29:32 PM as an example. The same thing for A3 and B2. ...
Do you have any idea how I can achieve this? Is there a way to do that? Do I need some special code to accomplish this?
Thank you for your help.
BTHi,
a way is to create a store proc that make the calculation
(fetching results in a temp table).|||
yes you can
you can use formula like this
=ReportItems!A.Value.Subtract(ReportItems!B.Value)
where A and B are the name of the cells in your table
noteSubtractfunction in datetime returns timespan|||
Hi,
IMHO the formula
ReportItems!A.Value.Subtract(ReportItems!B.Value)
calculate difference between value of the same row.
I've understood that Salmiya have to calculate between a value of column A with
value of column B, but of previous row.
Thank you.|||tblDates :
PK A B
----------------
1 5/2/2005 09:39:02 AM | 5/3/2005 06:29:32 PM |
2 5/4/2005 08:21:31 AM | 5/5/2005 07:02:29 PM |
3 5/6/2005 09:52:33 AM | 5/6/2005 07:04:31 PM |
4 5/7/2005 09:20:33 AM | 5/8/2005 08:26:36 AM |
You can do :
Select [Difference] = A-IsNull((Select B from tblDates where PK=2 ),0) from tblDates where PK=3
HTH,
Best Regards,
Hemchand|||Hi.....
U can use =ReportItems!textbox1.Value - ReportItems!textbox2.Value
Then U will get it..........
Best Regards....
No comments:
Post a Comment