Thanks Linda,I have one more question :I need help with the below statement, I trying to figure out what is wrong with it :countdistinct(Iif(DateOnly(@sapInvoiceDate) > DateOnly(MonthsAgo(12) && DateOnly(@sapInvoiceDate) < GetDate() ),@id,0) )RegardsShiva