Skip to Content
0
Former Member
Oct 19, 2012 at 03:37 AM

GRPO

20 Views

HI FRIENDS ,

BELOW FMS query i need to add the GRPO qty. how do i add. actually this is automattically generate the batch number query

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