Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
keyursoni85
Posting Yak Master
233 Posts |
Posted - 2012-05-22 : 07:53:06
|
I have exchange rate table in which there are multiple date wise records with exchange rate.Date Rate17/05/2012 523/05/2012 627/05/2012 7 Now I want rate while passing any date like if, I pass 20/05/2012 then rate 5 should return because 20/05/2012 elapse in date range 17 and 23 may 2012. |
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2012-05-22 : 08:42:03
|
SELECT TOP 1 rateFROM yourTableWHERE @yourParameter >= [Date]ORDER BY [date] descJimEveryday I learn something that somebody else already knew |
 |
|
keyursoni85
Posting Yak Master
233 Posts |
Posted - 2012-05-23 : 02:55:59
|
thanks. |
 |
|
|
|
|