Skip to Content
author's profile photo Former Member
Former Member

Query for Fill Rate

Hello Everyone,

I am trying to analyze our company's Fill rate and I have got this query which gives me details of all the Sales Orders with the number of items ordered.

Now I want to calculate my Fill Rate which is

Total No. of Lines Ordered/Total No. of lines Shipped.

Using Pivots I can easily calculate what are the number of lines on that order but I am able to calculate number of lines delivered on first delivery. Pls. help.

SELECT a. docnum, a. docdate, a. cardcode, a. cardname, b. itemcode, b. dscription, b. quantity, b. U_XX_Atreserve, b. linetotal, b. docentry as 'FromDoc', c. Docentry as 'Todoc', d. docnum as 'Delnum', c. actdeldate from ordr a (nolock) inner join rdr1 b (nolock) on a. docentry = b. docentry inner join dln1 c (nolock) on a. docnum = c. baseref and b. Docentry = c. baseentry and b. itemcode = c. itemcode and b. dscription = c. dscription and b. trgetEntry = c. Docentry inner join odln d (nolock) on c. docentry = d. docentry WHERE a.[DocDate] >=[%0] and a.[DocDate] <=[%1]

Add comment
10|10000 characters needed characters exceeded

0 Answers