Differences
This shows you the differences between two versions of the page.
|
|
|
kb:kb_item_328 [2019/01/24 09:44] external edit |
kb:kb_item_328 [2019/03/21 14:29] (current) runger [Resolution Notes] |
| |
| ==== Resolution Notes ==== | ==== Resolution Notes ==== |
| <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.</p><p>For dates, use the following SQL statement: convert(varchar,date_field,112) as [Converted_Date]. 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]. 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. 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.</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 |