Casting Date And Time Fields

Casting Date And Time Fields

book

Article ID: KB0078402

calendar_today

Updated On:

Products Versions
TIBCO Cloud Integration - Connect ( Scribe ) -

Description

When processing records using a TIBCO Scribe® Online Solution, the Query block has an option to process only new and updated records labeled Process only records created or updated since last run. If this option is enabled,  TIBCO Scribe® Online uses a user-specified datetime field to determine which records are new or have been updated.  However, if there is no datetime field available in your source data, you can create one in some databases.  See the examples below:

My ERP SQL database has two separate Date and Time fields that track the last modification of records. How can I use these fields to determine the Last Modification of a record using TIBCO Scribe® Online?

For example:
 
NameLast Date ModifiedLast Time Modified
Advanced Paper Co2012-10-16 00:00:00.0001754-01-01 14:25:47.987
A potential solution is to create a new field or view in your ERP system to select only the date or time and cast these two values together to a single field.

For example:

CAST(CAST([Last Date Modified] AS DATE) AS DATETIME) + CAST([Last Time Modified] AS TIME) AS [Scribe Last Modified]
 
NameScribe Last ModifiedLast Date ModifiedLast Time Modified
Advanced Paper Co.2012-10-16 14:25:47.9872012-10-16 00:00:00.0001754-01-01 14:25:47.987
 
For additional information, see the following in the TIBCO Scribe® Online Help:  
 

Issue/Introduction

Describes how to create a special Scribe Modified On field in your source database to filter source records for new and updated records.