Different results in bteq and sql assitant for current_date with format option

General
Enthusiast

Different results in bteq and sql assitant for current_date with format option

Hi,

why we are getting different results when the same query is executed in bteq and sql assitaint ?.

select current_date (format 'MMM');
Oct

same query in Sql Assitant is not giving expected result Oct.

what settings has to done in Sql assitant to get the same result without using any casting function ?

Thanks
Sakthi
2 REPLIES
Junior Contributor

Re: Different results in bteq and sql assitant for current_date with format option

Hi Sakthi,
there's no setting in SQL Assistant to achieve the same result.

FORMAT was used for BTEQ reports, which uses CLI and requests the result as a formatted string
If you want to get the same result using ODBC/JDBC etc. you have to add a typecast:

select current_date (format 'MMM') (char(3)
or
select trim(current_date (format 'MMM'))

Dieter
Enthusiast

Re: Different results in bteq and sql assitant for current_date with format option

Thanks a lot Dieter .