Hello All,
I have a query which works fine for a static data.
Select Top 1 Machinenames from AdminTable where datediff(d,actionbyDate, Getdate()) >2 .
Below is the sample data
| Duration | MachineNames | ActionByDate |
| 20 | Test1 | 20/3/2016 |
| 30 | Test2 | 10/3/2016 |
| 2 | Test3 | 20/3/2016 |
| 10 | Test4 | 24/3/2016 |
The Problem is I am not able to handle the duration . The value should be from the Duration cell against the top 1 which is Random.
If there is any other way to achive this pls let me know.
Regards
Priyabrata