![]() |
|
Archives of the TeradataForumMessage Posted: Tue, 25 Mar 2008 @ 14:45:53 GMT
I agree to Victor. But what you could do is to join a calendar table (whether your own or the Table calendar from sys_calendar) and qualify on the current data to get the current month based on the Date you run the query. E.G.
select field1 as "month"
from table a
inner join sys_calendar.calendar c (or your own)
on a.field1 = year_of_calendar||(month_of_year (format '99'))
where calendar_date=current_date
Or just qualify on the current Date
select field1 as "month"
from table a
where a.field1 = current_date (format 'YYYYMM') (char(6)) (depending
on your Fieldtype)
Hope this helps. Joerg
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||