Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### SSIS | Generate Datekey (int) from Date field
- This expression will extract the date from the field <datetime>
- in format YYYYMMDD and it will be converted to integer
- i.e. '2017-01-03 13:18:13.667' --> 20170103 (int)
- Just replace <datetime> for your field name
- ```
- (DT_I4)((DT_WSTR,4)(DATEPART("yyyy", <datetime>)) +
- RIGHT("0" + (DT_WSTR,2)DATEPART("mm", <datetime>), 2) +
- RIGHT("0" + (DT_WSTR,2)DATEPART("dd", <datetime>), 2))
- ```
Add Comment
Please, Sign In to add comment