Wiki

Scale Your Enterprise

User Tools

Site Tools


kb:kb_item_328

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

kb:kb_item_328 [2019/01/24 09:44]
external edit
kb:kb_item_328 [2019/03/21 14:29] (current)
runger [Resolution Notes]
Line 12: Line 12:
  
 ==== Resolution Notes ==== ==== Resolution Notes ====
-<p>Working with dates and times when importing data into SAP Business One can be a little tricky.&nbsp; A specific format is required for the DI to understand what is being passed in.</p><p>For dates, use the following SQL statement: convert(varchar,date_field,112) as [Converted_Date].&nbsp; This will create the date in YYYYMMDD format.</p><p>For times, use the following SQL statement: right('00' + cast(datepart(HOUR,date_field) as varchar),2) + right('00' + cast(datepart(MINUTE,date_field) as varchar),2) as [Converted_Time].&nbsp; This will create the time in HHMM format, with  zero padding as needed.</p><p>In both examples, "date_field" is the date field you need to convert.</p><p>If the SAP field is just a date, the date format is fine.&nbsp; You do not need to provide a time value.&nbsp; When an actual time value is needed, it will be in a separate field in the data record.&nbsp; This is the case where you will use the time format as shown.</p>+Working with dates and times when importing data into SAP Business One can be a little tricky. A specific format is required for the DI to understand what is being passed in. 
 + 
 +For dates, use the following SQL statement: 
 +<code sql> 
 +convert(varchar,date_field,112) as [Converted_Date] 
 +</code> 
 +This will create the date in YYYYMMDD format. 
 + 
 +For times, use the following SQL statement: 
 +<code sql> 
 +right('00' + cast(datepart(HOUR,date_field) as varchar),2) + right('00' + cast(datepart(MINUTE,date_field) as varchar),2) as [Converted_Time] 
 +</code> 
 +This will create the time in HHMM format, with  zero padding as needed. 
 + 
 +In both examples, "date_field" is the date field you need to convert.  If the SAP field is just a date, the date format is fine. You do not need to provide a time value.& When an actual time value is needed, it will be in a separate field in the data record. This is the case where you will use the time format as shown.
 ==== KB Type ==== ==== KB Type ====
 HowTo HowTo
kb/kb_item_328.1548341071.txt.gz · Last modified: 2019/01/24 09:44 by