Topic: Extract date parts, and put it back together again
Extract date parts, and put it back together again
Hi everyone,
I am using the "Extract date part" transformer to do some checks on the weekdays of my dates. Records with certain weekdays I write into a separate staging table and do an analysis of it there. But my question is: How can I create a new date value based on my date parts? It seems there is a "Extract date parts" transformer but not a transformer to "combine parts into a date" transformer?
I am using the "Extract date part" transformer to do some checks on the weekdays of my dates. Records with certain weekdays I write into a separate staging table and do an analysis of it there. But my question is: How can I create a new date value based on my date parts? It seems there is a "Extract date parts" transformer but not a transformer to "combine parts into a date" transformer?
Can't you just use the original/input date column? It sounds from your example that it should already be available since you pick date parts from it.
Must have not written it to the staging table, since it is not available there. I only have year, month, and day of month.
Hi Ben,
Here's what you can do then (at the risk of loosing a bit of precision compared to your original dates): First concatenate all your date part fields using the Concatenator transformer. Then use the Convert to Date transformer and pick a date mask that matches how you concatenated them. That should do what you need, but of course if you dont have all date parts (eg. seconds or whatever) you will loose precision.
Here's what you can do then (at the risk of loosing a bit of precision compared to your original dates): First concatenate all your date part fields using the Concatenator transformer. Then use the Convert to Date transformer and pick a date mask that matches how you concatenated them. That should do what you need, but of course if you dont have all date parts (eg. seconds or whatever) you will loose precision.
Log in by clicking the login link at the top of the screen
Go back to forum.


