back to forum.

Topic: Extract date parts, and put it back together again

Topic by
beno

2011-12-23
07:23

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?

Reply by
kasper

2011-12-23
07:21
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.

Reply by
beno

2011-12-26
20:11
Must have not written it to the staging table, since it is not available there. I only have year, month, and day of month.

Reply by
kasper

2011-12-26
23:18
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.

You need to be logged in to participate

In order to post your own comments on this topic, you need to be logged in.

Username:

Log in by clicking the login link at the top of the screen

 

Go back to forum.