Skip to Content
0
Former Member
Sep 26, 2012 at 04:51 AM

Grpo qty with Batch number

215 Views

hi freinds,

below query is the batch number automatic creation FMS

in this fms query i need to attach GRPO full qty. is it possible. every GRPO we will received always one line item not multiple item.

Select A.Code + A.Nos from (

Select max(Right(LEFT(Indicator,4),2)) as Code ,

(Select isnull(Right(MAX(BatchNum)+1,7),'000001')+'01' from OIBT where InDate>=GETDATE()

and

LEN(Batchnum)=9 and

indate between (select Min(f_refdate) from OFPR where

Indicator = (Select MAX(Indicator) from OFPR where Convert(nvarchar(10),GETDATE(),101) between F_RefDate and T_RefDate )) and

(select Max(T_refdate) from OFPR where

Indicator = (Select MAX(Indicator) from OFPR

where Convert(nvarchar(10),GETDATE(),101) between F_RefDate and T_RefDate )))as Nos

from OFPR

Where Convert(nvarchar(10),GETDATE(),101) between F_RefDate and T_RefDate

) A

Attachments

pastedImage_0.png (45.0 kB)