Thanks for taking time to reply.
A friend has just come up with the answer as follows:
INNER JOIN (SELECT AccountingYear * 100 + AccountingPeriod AS YRPR,AccountingYear,AccountingPeriod,PeriodClosed,ROW_NUMBER() OVER(PARTITION BY AccountingYear * 100 + AccountingPeriod ORDER BY AccountingDate) AS RowNo FROM accountingCalendar) AS DTBL ON gli.GLYearPeriod = DTBL.YRPR AND DTBL.RowNo = 1
Many Thanks,
Phil.
-------------------------------------------------------------------------------------
A neutron walks into a bar. "I'd like a beer" he says. The bartender promptly serves up a beer. "How much will that be?" asks the neutron. "For you?" replies the bartender, "no charge."
Two hydrogen atoms walk into a bar. One says, 'I think I've lost an electron.' The other says 'Are you sure?' The first says, 'Yes, I'm positive... '
Tommy Cooper