|
|
Archives of the TeradataForum
Message Posted: Fri, 18 Oct 2013 @ 18:57:35 GMT
Subj: | | Re: PPI Revaildation |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Friday, October 18, 2013 12:25 -->
Why manually parse when the computer does it for you? This query works on our data. Hope it helps.
select ix.databasename
, ix.tablename
, ix.indexname
, substr(ix.constrainttext,(position (' BETWEEN DATE ' in ix.constrainttext)+15), 10) as StartDate
, substr(ix.constrainttext,(position (' AND DATE ' in ix.constrainttext)+11), 10) as EndDate
, ix.constrainttext
from dbc.indexconstraints ix
where ix.constrainttype = 'Q'
and constrainttext like '%BETWEEN DATE%'
and substr(Enddate,1,4) = '2013'
| |