Append if not equal (1 Viewer)

mdvr613

New member
Local time
Today, 18:28
Joined
Mar 4, 2013
Messages
9
Good afternoon all I have the below code:

PHP:
INSERT INTO [New Package Port] ( NWID, Title, Courier, [Inter Office], [No Lc], Reference, [Product Type], [Tracking Number], [LC 2], [LC 3], [LC 4], [LC 5], [LC 6], [LC 7], [LC 8], [LC 9], [LC 10], [LC 11], [LC 12], [LC 13], LCNum, LCRange, [LC 14], [LC 15], [LC 16], [LC 17], [LC 18], [LC 19], [LC 20], Created, [Created By] )
SELECT [New Package].ID , [New Package].Title, [New Package].Courier, [New Package].[Inter Office], [New Package].[No Lc], [New Package].Reference, [New Package].[Product Type], [New Package].[Tracking Number], [New Package].[LC 2], [New Package].[LC 3], [New Package].[LC 4], [New Package].[LC 5], [New Package].[LC 6], [New Package].[LC 7], [New Package].[LC 8], [New Package].[LC 9], [New Package].[LC 10], [New Package].[LC 11], [New Package].[LC 12], [New Package].[LC 13], [New Package].LCNum, [New Package].LCRange, [New Package].[LC 14], [New Package].[LC 15], [New Package].[LC 16], [New Package].[LC 17], [New Package].[LC 18], [New Package].[LC 19], [New Package].[LC 20], [New Package].Created, [New Package].[Created By]
FROM [New Package]
WHERE ((("where [New Package].[ID]") > "LAST [New Package Port].[nwid]"));
All I want is to add the New Package.ID (Record/row) if greater than the New Package Port.NWID

This should be a peice of cake for you guys, assistance and guidance is greatly appreciated
 
Last edited:

MarkK

bit cruncher
Local time
Today, 15:28
Joined
Mar 17, 2004
Messages
8,186
So are you essentially copying those records to a table that differs only by name? What is the difference between a NewPackage and a new NewPackagePort?
 

mdvr613

New member
Local time
Today, 18:28
Joined
Mar 4, 2013
Messages
9
So are you essentially copying those records to a table that differs only by name? What is the difference between a NewPackage and a new NewPackagePort?

Hi labolt,

The NewPackage Table currently has restricted fields as it's a linked table from a SharePoint site with a InfoPath smartform (Data from form ports to backend table).

For me to manipulate (VBA) the merged data to single row entries on a serparate table, I have to port all information from NewPackage to NewPackagePort first. All I want to accomplish here is when a new item is added to the NewPackage table for such to be added to the back end table New Package Port (Hope that clears your question)

Direct and simple answer: No difference between tables, data elements are all the same. The only issue is the New Package table has restrictions set by SharePoint that I can not manipulate data, which requiers me to port to a backend table with no restrictions. So if ID > NWID I need that record added to the back end table.
 

MarkK

bit cruncher
Local time
Today, 15:28
Joined
Mar 17, 2004
Messages
8,186
I'd try a where clause something like this . . .
Code:
WHERE [New Package].ID > ( SELECT Max(nwid) FROM [New Package Port] )
. . . so the subquery finds the Max(nwid) in the port table. See if that works.
Cheers,
 

mdvr613

New member
Local time
Today, 18:28
Joined
Mar 4, 2013
Messages
9
I'd try a where clause something like this . . .
Code:
WHERE [New Package].ID > ( SELECT Max(nwid) FROM [New Package Port] )
. . . so the subquery finds the Max(nwid) in the port table. See if that works.
Cheers,

You Mate are D Man! Enjoy your weekend!
 

Users who are viewing this thread

Top Bottom