Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

G/L budget amounts are imported into the wrong periods in the North American version of Microsoft Dynamics NAV 2013


View products that this article applies to.

Symptom

When you import a G/L budget from Excel, the amounts are imported into the wrong periods in the North American version of Microsoft Dynamics NAV 2013. For example, January amounts are imported into December, February amounts are imported into January, etc.  

↑ Back to the top


Cause


This problem is caused by the way the .net variable DateTimeHelper.FromOADate(Decimal) function handles time zones.

↑ Back to the top


Resolution

To resolve this problem, follow these steps:   

  1. Add the line of code in bold to the ParseCellValue function in table 370 - Excel Buffer:  
     
    IF ((STRPOS(FormatString,'y') <> 0) OR  
    (STRPOS(FormatString,'m') <> 0) OR  
    (STRPOS(FormatString,'d') <> 0)) AND  
    (STRPOS(FormatString,'Red') = 0)  
    THEN BEGIN  
    // Excel Date is stored in OATime format  
    Decimal += 0.5; // Add time offset to help FromOADate select the correct date.  
    DateTime := DateTimeHelper.FromOADate(Decimal);  
    "Cell Type" := "Cell Type"::Date;  
    "Cell Value as Text" := FORMAT(DT2DATE(DateTime));  
    EXIT;  
    END;

↑ Back to the top


More Information

 This article applies to the North American version of Microsoft Dynamics NAV 2013


↑ Back to the top


Keywords: kbsurveynew, kbmbspartner, kb

↑ Back to the top

Article Info
Article ID : 2836457
Revision : 1
Created on : 1/7/2017
Published on : 9/6/2013
Exists online : False
Views : 194