How to change Date datatype so it is NOT "smalldatetime

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
McKBISupport2
Premium Member
Premium Member
Posts: 1
Joined: Thu Mar 27, 2008 3:25 pm

How to change Date datatype so it is NOT "smalldatetime

Post by McKBISupport2 »

I am trying to insert records in a SQL Server table with date fields that are datatype "date". Somehow the date fields seem to default to "smalldatetime", which prevents me from inserting dates outside of the range between 01/01/1900 through 06/06/2079. I need to insert records with years up to 9999 and as low as 1753 (please don't ask why... this is a user request).

This is a simple job that reads from a flat file, goes through a simple date validation and is written to the SQL Server table.

Below is an example of what I coded in the Transform stage:

l_inFFSCur.CRTE_DT[1,4] : "-" : l_inFFSCur.CRTE_DT[5,2] : "-" : l_inFFSCur.CRTE_DT[7,2]

This is the error I get when I try to insert year 17530101 or 99990101 in the date field:

APT_CombinedOperatorController,0: [DataDirect][ODBC SQL Server Driver]Datetime field overflow

Where is the date datatype being set so it does NOT default to smalltimedate? Could this be an ODBC setting for Date?

Any help will be greatly appreciated!

Thanks,
Joy
Post Reply