Format funciton ignored from SQL Assistant

Database
Enthusiast

Format funciton ignored from SQL Assistant

Format funciton is kind of ignored from SQL Assistant

SELECT CURRENT_TIME (FORMAT 'HH-MI-SS');

20:56:50+00:00

SELECT CURRENT_DATE (FORMAT 'DD-MM-YY');

02-Nov-11

However from Bteq it works normally:

SELECT CURRENT_DATE (FORMAT 'DD-MM-YY');

 *** Query completed. One row found. One column returned.

 *** Total elapsed time was 1 second.

    Date

--------

02-11-11

1 REPLY
Enthusiast

Re: Format funciton ignored from SQL Assistant

Hi,

   SQL assistant has its own format for Date and timestamp values. In SQL assistant , You can't see the date output in the format specified in the query while it displays. Bteq will not change the format of the output.

If you want to check whether your format command works as expected , cast the result to a char field as shown below.

SELECT cast ( ( CURRENT_TIME (FORMAT 'HH-MI-SS') ) as char(8)) ; 

Current Time(0)

16-29-13

SELECT cast ( ( CURRENT_TIME (FORMAT 'MI-SS') ) as char(5)) ;

Current Time(0)

29-37