Home » SQL & PL/SQL » SQL & PL/SQL » pls help in query (pl sql)
pls help in query [message #608427] Wed, 19 February 2014 10:02 Go to next message
simplesanju
Messages: 11
Registered: July 2008
Junior Member


Hi ,

I have this query:

SELECT * FROM RRCV_EXCHANGE_RATE WHERE FK_SRC_CURRENCY_ID ='HKD' AND FK_TGT_CURRENCY_ID='USD' and Effective = :p1

my requirement is
If :p1 is the future date, need to retrieve record from the most recent date in table. If it is in the past, need data of closest date of past date.

Thanks in advance
Re: pls help in query [message #608442 is a reply to message #608427] Wed, 19 February 2014 12:48 Go to previous messageGo to next message
Michel Cadot
Messages: 57611
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

So do it.

Re: pls help in query [message #608445 is a reply to message #608427] Wed, 19 February 2014 13:18 Go to previous message
Michel Cadot
Messages: 57611
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Note that if you do not store dates in the future in your table (one thing among many others you didn't tell us), the latest date is the same than the closest date and so you have only one case.

Previous Topic: Value multiplication help
Next Topic: SELECT INTO causes ORA-00905 Error
Goto Forum:
  


Current Time: Fri Apr 18 12:23:14 CDT 2014

Total time taken to generate the page: 0.13422 seconds