Why will this not pull back all of the max serial rows I'm needing for the notes field? It does it correctly for about 90% of the records? Any other ideas for getting max record pulled for a notes(text) field? The max record row for the notes field will also have text in it everytime never null.
Sql Server 2005
select a.serial,a.clientid,a.caseno,a.applid, a.applname,(a.status + ' / ' + a.statusreason)as Status,b.notes
from vwAP a
left outer join vwRQ b with(nolock)
on a.serial = b.appserial
and a.clientid = b.clientid
and b.serial in (select max(serial) from vwRQ with(nolock)
where requirement = ('qc')
and notes like ('% %')
group by appserial)
where a.status in ('corrections','returned by client','corrections submitted')
Sql Server 2005
select a.serial,a.clientid,a.caseno,a.applid, a.applname,(a.status + ' / ' + a.statusreason)as Status,b.notes
from vwAP a
left outer join vwRQ b with(nolock)
on a.serial = b.appserial
and a.clientid = b.clientid
and b.serial in (select max(serial) from vwRQ with(nolock)
where requirement = ('qc')
and notes like ('% %')
group by appserial)
where a.status in ('corrections','returned by client','corrections submitted')