D
DIH
OK,
I have an append query that will send data to an as400 system. There is
a field in the as400 table that simply wants a number for each record
(we'll call this field batchnum). Somehow I need the append query to
write this batchnum into each record that get appended. The field name
in the as400 table is called INTRN. For my use now, everything is still
in Access.
For example (only a few of the real data fields are listed):
DATEprod ACT THEO batchnum
8/10/09 500 750 1
8/11/09 530 750 2
8/12/09 570 750 3
etc 4
etc 5
Again, DATEprod, ACT, THEO (and a bunch of others)are real data. It's
the batchnum that needs to get generated somehow.
Here is the current sql:
INSERT INTO BPCSUSRF_NINW ( INPROD, INWHSE, INLOC, INQTY, INREF, INDATE,
INTRAN, INREAS )
SELECT [DAILY SHIFT].CODE, "42" AS Ware, [DAILY SHIFT].LOCATION,
IIf([palletconfig]=True,([actual])/([units per layer]*[layers per
pallet]),[actual]) AS ACT,
IIf([palletconfig]=True,([theoretical])/([units per layer]*[layers per
pallet]),[theoretical]) AS THEO, Format([DATEprod],"yyyymmdd") AS DATE1,
"MK" AS MKTrans, [DAILY SHIFT].[WORK CENTER]
FROM [product codes] INNER JOIN [DAILY SHIFT] ON ([product codes].[Line
#] = [DAILY SHIFT].LINE) AND ([product codes].Code = [DAILY SHIFT].CODE)
WHERE ((([DAILY SHIFT].DATEprod)=[forms]![frmBPCS]![txtDate]) AND
(([DAILY SHIFT].SentToBPCS)=No))
GROUP BY [DAILY SHIFT].CODE, "42", [DAILY SHIFT].LOCATION,
IIf([palletconfig]=True,([actual])/([units per layer]*[layers per
pallet]),[actual]), IIf([palletconfig]=True,([theoretical])/([units per
layer]*[layers per pallet]),[theoretical]), Format([DATE],"yyyymmdd"),
"MK", [DAILY SHIFT].[WORK CENTER]
HAVING (((IIf([palletconfig]=True,([theoretical])/([units per
layer]*[layers per pallet]),[theoretical]))<>0));
Any help is greatly appreciated!
Dave
I have an append query that will send data to an as400 system. There is
a field in the as400 table that simply wants a number for each record
(we'll call this field batchnum). Somehow I need the append query to
write this batchnum into each record that get appended. The field name
in the as400 table is called INTRN. For my use now, everything is still
in Access.
For example (only a few of the real data fields are listed):
DATEprod ACT THEO batchnum
8/10/09 500 750 1
8/11/09 530 750 2
8/12/09 570 750 3
etc 4
etc 5
Again, DATEprod, ACT, THEO (and a bunch of others)are real data. It's
the batchnum that needs to get generated somehow.
Here is the current sql:
INSERT INTO BPCSUSRF_NINW ( INPROD, INWHSE, INLOC, INQTY, INREF, INDATE,
INTRAN, INREAS )
SELECT [DAILY SHIFT].CODE, "42" AS Ware, [DAILY SHIFT].LOCATION,
IIf([palletconfig]=True,([actual])/([units per layer]*[layers per
pallet]),[actual]) AS ACT,
IIf([palletconfig]=True,([theoretical])/([units per layer]*[layers per
pallet]),[theoretical]) AS THEO, Format([DATEprod],"yyyymmdd") AS DATE1,
"MK" AS MKTrans, [DAILY SHIFT].[WORK CENTER]
FROM [product codes] INNER JOIN [DAILY SHIFT] ON ([product codes].[Line
#] = [DAILY SHIFT].LINE) AND ([product codes].Code = [DAILY SHIFT].CODE)
WHERE ((([DAILY SHIFT].DATEprod)=[forms]![frmBPCS]![txtDate]) AND
(([DAILY SHIFT].SentToBPCS)=No))
GROUP BY [DAILY SHIFT].CODE, "42", [DAILY SHIFT].LOCATION,
IIf([palletconfig]=True,([actual])/([units per layer]*[layers per
pallet]),[actual]), IIf([palletconfig]=True,([theoretical])/([units per
layer]*[layers per pallet]),[theoretical]), Format([DATE],"yyyymmdd"),
"MK", [DAILY SHIFT].[WORK CENTER]
HAVING (((IIf([palletconfig]=True,([theoretical])/([units per
layer]*[layers per pallet]),[theoretical]))<>0));
Any help is greatly appreciated!
Dave