September 12, 2013, 11:14 AM
JALDbaDevHow to get highest date in two different SCDs
I have a synonym made up of 5 tables: a fact table and 4 dimension tables - 2 of those being a slowly changing dimension. Trying to come up with a query that will get data for the most recent date in both scd's. I can do one, but two is giving me fits.
PolicyHolder Agency
Pol_Cd Agecny_Num
Rec_Eff_Dt Rec_Eff_Dt
When I do this:
Table File Synonym1
SUM
max.Policyholder.Rec_Eff_Dt
max Agency.Rec_Eff_Dt
By lowest Pol_CD
END
It displays the wrong Policyholder.Rec_Eff_Dt but the correct Agency.Rec_Eff_Dt.
Any ideas on how to get both? Thanks!
September 12, 2013, 11:18 AM
JALDbaDevSorry this got jumbled up:
SCD1: PolicyHolder Fields are: Pol_Cd Rec_Eff_Dt
SCD2: Agency Fields are: Agency_Num Rec_Eff_Dt
September 12, 2013, 11:25 AM
PrarieWhat format are your dates in?