Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Column alias after function?

Status
Not open for further replies.

shagymoe

Programmer
Apr 20, 2001
72
US
I am wondering how to include the column name as an alias after performing the to_char function. Here is the query:
Code:
select seq_number AS SEQUENCE, ref_code AS PART_NUMBER, to_char(insert_date, 'HH24:MI DD-MON-YY')AS DATE from table where ref_code like '5555555';

The "AS DATE" part returns an error. If I take it out, the other column headings get the alias...so I'm wondering how to give the insert_date column an alias in the report.

Thanks.

 
DATE is a reserved word. Try a different alias.

Good luck!

Code:
select * from Life where Brain is not null
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
[sup]When posting code, please use TGML for readability. Thanks![sup]
 
Code:
select seq_number AS SEQUENCE, ref_code AS PART_NUMBER, to_char(insert_date, 'HH24:MI DD-MON-YY')AS "DATE" from table where ref_code like '5555555'
 
Thanks....it didn't occur to me, but should have.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top