Link to home
Start Free TrialLog in
Avatar of PRINCE101
PRINCE101Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Converting of date to integer

Hi,

Am trying to populate a snapshot fact table, i decided to add a derived column to get the current date but then i need to write an expression to convert the date into integer value as my destination is integer. this is my expression (DT_WSTR,30)(DT_DBDATE)GETDATE() and i did the data conversation to four-bye signed which brought the error below.
any help on how to convert the current date to an integer so i can mapped the source and the destination correctly..
many thanks


[Get Today's Date [902]] Error: An error occurred while attempting to perform data conversion. The source type could not be converted to the destination type.
[Get Today's Date [902]] Error: SSIS Error Code

DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "component "Get Today's Date" (902)" failed because error code 0xC0049062 occurred, and the error row disposition on "output column "TodaysDate" (908)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Question: why use an int rather than a date?
Question: What is the format of your integer yyyymmddhhmm ??  yymmddhhmm ? yymmdd?

which style of date are you using date2? maybe converting it to a nvchar and then to an int may be what you need to do?
SOLUTION
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PRINCE101

ASKER

Thank you all.. you guys are live saver.. glad to link with you guys