I mean specifically, which records (consumer PK and apphours) would you expect in your results?
Example: 2, 12 and 3, 14
On 21 June 2018 14:28:10 GMT-04:00, Ken Dibble krdibble@stny.rr.com wrote:
At 02:21 PM 6/21/2018, you wrote:
What's your expected output from the data you presented?
Answer: 2 Approved Consumers, having a total of 12 Hours.
I did include that in my original post.
To make it a little easier for people to try to help, here's some code to build up the data and my attempt at what I've understood as your requirements:
[snip]
Thank you for doing that. Wow, I'm sorry I omitted that. I usually do that when I ask for help with queries.
Ken
[excessive quoting removed by server]
At 02:33 PM 6/21/2018, you wrote:
I mean specifically, which records (consumer PK and apphours) would you expect in your results?
There are two Consumers whose most recent (last) status is "Approved": Consumer PKs 1 and 3. The relevant Status records are Status PKs 2 (for Consumer 1) and 8 (for Consumer 3).
Of those two Consumers, only Consumer 3 has any Hours records at all. The value for Consumer 3's most recent (last) hours record is 12 (Hours record PK 4).
Thanks.
Ken