Date Difference in Hours And Minutes
ricky76
Member Posts: 204
I have two dates on a report that i want to calculate the difference in hours and minutes between them. How can i do this? My two dates for example are 10/10/05 06:03 and 10/10/05 14:33. I am able to display it as 8.5 hours or 0.35 days as the date difference but ideally i would like to display it as 8hrs 30 minutes. Any help will be appreciated.
0
Comments
-
If you have 2 date time fields you can subtract them into a duration
Try to define a variable of the type Duration and see if this works for you.0 -
Thank you0
-
Is there anyway i can sum a duration field? My report is grouped and i would like to put a total in hours and minutes for each group0
-
You can just do
Duration1 := Duration2 + duration3
0 -
This has not worked. I only have one variable, Duration 1, which is in the body of the report. Each grouping can have varying number of entries in it so in effect i need to sum Duration 1 which i know i can not do but am unsure how to get around it.0
-
In OnPreReport (I think, it may have to go to OnPreDataItem):
CurrReport.CREATETOTALS("Duration 1");Then you put a textbox in the groupfooter and set the SourceExpr to "Duration 1" and it should automatically display the group totals.
What also may work is to put it into the GroupTotalFields property of the dataitem, but I hink that only works for fields.
Just play around with those properties and commands, and read the adg about reports.0 -
Unfortunately this doesn't work because i can't create a total on a field that is not a decimal. Is what i am trying possible?0
-
Did you try evaluation the duration into a decimal, keeping the decimal as a total and then converting it back to a duration in a groupfooter section? I am just brainstorming here, I have no idea if this will work.0
-
Still no joy i'm afraid but thanks for your help0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 322 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

