![]() |
|
Archives of the TeradataForumMessage Posted: Tue, 29 Apr 2008 @ 23:42:23 GMT
Oops - that second case should be "then current_date" not "then current_date -1"
SNPSHT_DT between
Case
when extract(day from current_date)) = 1 then add_months(current_date, -1)
else cast(current_date/100 * 100 + 1 as date)
end
And
Case
when extract(day from current_date)) = 1 then current_date
else SNPSHT_DT
end
Dave
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||