Convert DATE to FORMAT 1900 (Excel)

BlackMagic
Member Posts: 38
Hi guys.
For integration beetween a route planning system and Dynamics NAV5 I need to export a CSV file containing a delievery date. But the target software want the date presented in FORMAT 1900 (Excel format). This is an integer presented the quantity of days after 01/01/1900.
Eg. 14/11/08 in FORMAT 1900 got the value: 39767.
Can anyone tell me an easy way to do this conversion?
I have try Google for an algorithm or an automation but I didnt find any usable, and I think developing an algorithm by my own would take too long time.
So my best idea I could come to is exporting the date value from NAV to a cell in Excel file (eg. A1) and make a formula in cell B1 doing the conversion, then I could import the value from this field.
But I hope any know an easier way like using an automation or an algorithm.
Thanks for advance.
For integration beetween a route planning system and Dynamics NAV5 I need to export a CSV file containing a delievery date. But the target software want the date presented in FORMAT 1900 (Excel format). This is an integer presented the quantity of days after 01/01/1900.
Eg. 14/11/08 in FORMAT 1900 got the value: 39767.
Can anyone tell me an easy way to do this conversion?
I have try Google for an algorithm or an automation but I didnt find any usable, and I think developing an algorithm by my own would take too long time.
So my best idea I could come to is exporting the date value from NAV to a cell in Excel file (eg. A1) and make a formula in cell B1 doing the conversion, then I could import the value from this field.
But I hope any know an easier way like using an automation or an algorithm.
Thanks for advance.
0
Comments
-
In Nav Isn't Date - Date = Integer?
Also you could use the Date Virtual Table as follows:
DateRec.Setrange(Type,DateRec.Type::Date);
DateRec.Setrange(PeriodStart,01011900D,MyNewDate);
DatRec.COUNT;0 -
Very nice solutions! Thank you alot
.
0 -
You're welcome.0
-
kapamarou wrote:In Nav Isn't Date - Date = Integer?
I think stick with the integer, thats the best idea.
ExcelDate := NavDate - 12311899D; (or somethign like that)David Singleton0
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
- 320 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