This is just a sample it could be thounsand records like this. What I am looking is to detect the most recent date if and only if the status was pending.
For example the result from the sample should return
1 New Issue 2005-11-23 10:54:24.113 Pending
3 third 2005-11-23 10:54:24.177 Pending
These 2 records contain the 2 criteries first has to be status equal Pending and has to be the most recent record.If the most recent record for an specific product is different than Pending this won't be part of our result.
ID Product Date Status
1 New Issue 2005-10-23 10:25:17.483 Pending
1 New Issue 2005-10-24 10:43:02.963 Accepted
1 New Issue 2005-11-10 10:53:03.237 Denied
1 New Issue 2005-11-23 10:54:24.113 Pending
2 Secondary 2005-11-14 10:25:17.340 Pending
2 Secondary 2005-11-15 10:43:03.043 Accepted
2 Secondary 2005-11-16 10:53:03.300 Denied
2 Secondary 2005-11-23 10:54:24.177 Pending
2 Secondary 2005-11-23 10:55:04.973 Accepted
3 third 2005-10-14 10:25:17.340 Pending
3 third 2005-10-15 10:43:03.043 Accepted
3 third 2005-11-23 10:54:24.177 Pending
I will appreciate any help.
Thanks
For example the result from the sample should return
1 New Issue 2005-11-23 10:54:24.113 Pending
3 third 2005-11-23 10:54:24.177 Pending
These 2 records contain the 2 criteries first has to be status equal Pending and has to be the most recent record.If the most recent record for an specific product is different than Pending this won't be part of our result.
ID Product Date Status
1 New Issue 2005-10-23 10:25:17.483 Pending
1 New Issue 2005-10-24 10:43:02.963 Accepted
1 New Issue 2005-11-10 10:53:03.237 Denied
1 New Issue 2005-11-23 10:54:24.113 Pending
2 Secondary 2005-11-14 10:25:17.340 Pending
2 Secondary 2005-11-15 10:43:03.043 Accepted
2 Secondary 2005-11-16 10:53:03.300 Denied
2 Secondary 2005-11-23 10:54:24.177 Pending
2 Secondary 2005-11-23 10:55:04.973 Accepted
3 third 2005-10-14 10:25:17.340 Pending
3 third 2005-10-15 10:43:03.043 Accepted
3 third 2005-11-23 10:54:24.177 Pending
I will appreciate any help.
Thanks