Posted 04 Mar 2011
How do you determine the month-end date when building a date dimension? One of our ETL developers recently pointed out that our date dimension (which I had populated) had incorrect values for month-end date, so I had to find a way to reliably calculate that value. Goal: For every date in the calendar, determine the date of the last day of that month. Example: for every day in March of 2011, the month-end date is 2011-03-31. |
I just ran the two statements from SRINIVAS... and they gave different results for July 2016. The first one gave 07/30/2016 and the second gave 07/31/2016. I can't exactly f...
|
Posted 11 Feb 2011
Problem: How do you add or subtract a "fractional second" to a TIMESTAMP column in Teradata?The available documentation is not very clear, so let's look into it using examples. Basic use of INTERVALBuild, Populate, and Query Test Table |
Posted 08 Feb 2011
Problem: There are many cases where a database stores the previous value along with the replacement value. When an update happens, it is important to validate that (using CDC terms) the "before image" matches the most-recent "after image". If those don't match, then the chain of updates is broken. The specific problem being solved here is where the prior value/new value pairs are stored in separate columns in the each row.
These prior value/new value pairs generally build a chain. But how do you know when that chain is broken? We'll build an example and show the query that flags the records where the chain is broken. |