I want to do BTEQ export to flat file .
I have a sql which gets the max(date) from table a. I want to store this max date in a file in the following format
max_date = '2014-09-04'
Is this possible in BTEQ export?
select cast(max(your_date) as date format 'YYYY-MM-DD') from your table;
in your bteq script after .export report file=your directory