FS Query the days of invoice delay
I need help to create formatted search query to get the number of days of delay most delayed invoice refreshed on BP Code
Your question is not clear, can you explain more i think you requirement is
When you want to make Sales order that time you need which oldest invoice still not paid?
select DATEDIFF(Day,min(t11.DocDueDate),SYSDATETIME()) as 'Days' from OINV t11 where t11.CardCode=$[$OINV.4.0.0] and T11.[DocStatus]='O'))
Please try above FMS