I think this is easier in SQL than BTEQ variables.
To store today's date just use the keyword DATE in an insert statement. (sel DATE
To get to the first day of the current month. Teradata dates are stored as integers so you can use some tricky math to get to day 1 of this month:
sel (((date/100)*100)+1)(date);
To get to the last day of the current month, you can also use math. Basically you go to the first day of next month and let Teradata date math handle the subtraction.
sel ((((((date/100)+1)*100)+1)(date)) - 1) (date);
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.