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 |
|
sw9mba
Starting Member
2 Posts |
Posted - 2009-10-09 : 12:08:03
|
| i have a tabla called mt_read which has three fields : mt_name,mt_value,mt_time.i want to select for a specific date-time from the mt_time field the exact closer to the specific date-time last value of mt_value field. |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-10-09 : 12:25:06
|
You can make it more clear by giving tablestructure, sample data and wanted output. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-10-09 : 12:44:48
|
may be thisSELECT TOP 1 mt_name,mt_value,mt_timeFROM yourtableWHERE mt_time<=@datevalORDER BY mt_time DESC |
 |
|
|
|
|
|