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!

oracle date conversion to SQL format

Status
Not open for further replies.

dhiner

Programmer
Jan 9, 2003
4
US
Hi,
I'm currently trying to import information from an Oracle database for yesterday's date. The date format in Oracle is '1030301'. I am unclear on how to write my import procedure to import yesterday's date in SQL. Does anyone have any ideas how I could convert the date format so that SQL will import yesterday's date without having to change the criteria every day to import the information?

Thanks in advance,
David Hiner, DBA
MCI/NCI
 
Sounds like you are using an Aspect phone switch. :)

I had the same problem. Try this formula for a where clause:

where(DATE_STAMP='1' || to_char(sysdate-1,'yymmdd'))

This is what you can pass to oracle to get back all of yesterday's data.

This formula will not work for dates before 2000.

Hope this helps.
 
Thanks jamminjaymeyer, works like a charm.

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top