how i can get first voucherdate and last voucherdate against
select distinct TD.LoanID, TI.VoucherDate from dbo.tblTransactionInformation TI
inner Join dbo.tblTransactionDetails TD on TI.TRCode = TD.TRCode Where TI.CompanyCode='CMP-007'
and TI.FyrCode='Fyr-014' and TI.VoucherDate between '01 - Jul - 2011'
and '30-Jun-2012' and (TI.StateStatus='Approved' or TI.StateStatus ='Checked') And TD.AccountCode='ACC-000577'
Order by TD.LoanID, TI.Voucherdate