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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TO_CHAR query help?

Status
Not open for further replies.

scottyjohn

Technical User
Nov 5, 2001
523
GB
Hi all,
I am trying to get some training material on the whole TO_CHAR and TO_DATE functions of Oracle DBMS but in the mean time I need help with the following query?
I have a view which has a date field defined as
TO_CHAR(TO_DATE(STARTLOCALTIME,'DD/MM/RRRR HH24:MI:SS'),'DD/MM/RRRR') as STARTDATE
which displays the field values as say, 17/10/2006. I need to query this fields and was trying
SELECT * FROM V_STATUS WHERE STARTDATE ='17/10/2006') but this doesnt work. Can anyone tell me how I should define that field's value in my query?
Thanks in advance!

John
[smile]
 
This is far from ANSI/ISO SQL. I suppose the people in an Oracle forum can help you with this.

The ANSI compliant way should be something like:
SELECT * FROM V_STATUS WHERE STARTDATE = DATE'2006-10-17'

But then you'll first have to re-define your view definition.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top