M
mcgj
I am looking for the best way to find the previous date of treatment from any
date.
I have a table that hold dates representing the last time a treatment was
made to a particular entity. These entities are related by a super-grouping
(several even though I only show one below). When treatments are made an
entity may or may not be treated within a super-grouping.
SupGrp EntitiyId Date
1 A 9/10/2007
1 B 9/10/2007
1 C 9/10/2007
1 B 9/15/2007
1 A 10/10/2007
So let's say I want the last application data previous to 10/15/2007 for
each entity within super-group 1. I would want the result to look something
like this:
SupGrp EntitiyId Date
1 A 10/10/2007
1 B 9/15/2007
1 C 9/10/2007
What is the best way to do this with a query?
date.
I have a table that hold dates representing the last time a treatment was
made to a particular entity. These entities are related by a super-grouping
(several even though I only show one below). When treatments are made an
entity may or may not be treated within a super-grouping.
SupGrp EntitiyId Date
1 A 9/10/2007
1 B 9/10/2007
1 C 9/10/2007
1 B 9/15/2007
1 A 10/10/2007
So let's say I want the last application data previous to 10/15/2007 for
each entity within super-group 1. I would want the result to look something
like this:
SupGrp EntitiyId Date
1 A 10/10/2007
1 B 9/15/2007
1 C 9/10/2007
What is the best way to do this with a query?