01.
Public
Shared
Function
Datecodelabel1(
ByVal
SLM_PRD_NAME
As
String
,
ByVal
SLP_DATE_CODE
As
String
,
ByVal
BCM_STATUS
As
String
,
ByVal
SLP_BOX_NO_T
As
String
,
ByVal
SLP_BOX_NO_F
As
String
)
As
DataTable
02.
03.
Dim
dt
As
New
DataTable
04.
strSql =
New
StringBuilder
05.
06.
07.
strSql.AppendLine(
"select distinct t.slp_prd_name ,t.slp_box_no,substr(t.slp_tray_no,-16,4)as date_code"
)
08.
09.
strSql.AppendLine(
"from fpcs_lot_serial_packing t "
)
10.
strSql.AppendLine(
"where (slp_prd_name = '"
& SLM_PRD_NAME &
"' )"
)
11.
strSql.AppendLine(
"and slp_box_no in ( "
)
12.
strSql.AppendLine(
"select"
)
13.
strSql.AppendLine(
"t.BCM_box_no as box_no"
)
14.
strSql.AppendLine(
"from fpc_box_cap_mstr t "
)
15.
strSql.AppendLine(
"left join fpc_box_cap_det A on t.bcm_prd_item_code = A.Bcd_Prd_Item_Code and t.bcm_box_no = A.Bcd_Box_No"
)
16.
strSql.AppendLine(
"left join fpc_box_cap_post B on t.bcm_prd_item_code = B.BCP_PRD_ITEM_CODE and t.bcm_box_no = B.BCP_BOX_NO"
)
17.
strSql.AppendLine(
"left join fpc_factory C on t.bcm_support_by = C.FACTORY_CODE"
)
18.
strSql.AppendLine(
"where (bcm_prd_item_code = REPLACE('9G'||'"
& SLM_PRD_NAME &
"','-','') )"
)
19.
strSql.AppendLine(
"and (A.BCD_PACK_DATE is not null)"
)
20.
strSql.AppendLine(
"and (bcm_status = upper('"
& BCM_STATUS &
"')) "
)
21.
strSql.AppendLine(
"and (A.BCD_SEQ_NO = '1')"
)
22.
strSql.AppendLine(
" ) "
)
23.
strSql.AppendLine(
"AND (t.slp_box_no >= '"
& SLP_BOX_NO_F &
"' OR '"
& SLP_BOX_NO_F &
"' IS NULL)"
)
24.
strSql.AppendLine(
"AND (t.slp_box_no <= '"
& SLP_BOX_NO_T &
"' || 'Z' OR '"
& SLP_BOX_NO_T &
"' IS NULL)"
)
25.
26.
strSql.AppendLine(
"order by slp_prd_name ,slp_box_no,substr(t.slp_tray_no,-16,4)"
)
27.
28.
Dim
StrQuery
As
String
=
""
29.
StrQuery = strSql.ToString
30.
dt = GetDataOracle(strSql.ToString,
"SLM_PRD_NAME"
, constrolacle).Tables(0)
31.
Return
dt
32.
33.
End
Function