Apend table query problem

SteveL

Registered User.
Local time
Today, 10:53
Joined
Dec 3, 2004
Messages
60
I have an append table query and can't figure out how to append the records to the table being appended if:

1) The data in and one of three fields, named "Ack_Date", "Resch_Date", OR "Ord_qty" has changed from previous records appended to the table

or if,

2) The record is not currently in the table.

The table being appended is named "tblRunCounterChanges". The key field is named "OpenOrdRecID".

Can anyone help with this?
--Steve
 
I have an append table query and can't figure out how to append the records to the table being appended if:

1) The data in and one of three fields, named "Ack_Date", "Resch_Date", OR "Ord_qty" has changed from previous records appended to the table

or if,

2) The record is not currently in the table.

The table being appended is named "tblRunCounterChanges". The key field is named "OpenOrdRecID".

Can anyone help with this?
--Steve

number 1 is impossible, practically (if I'm reading this right). but number two would be written like this:
PHP:
insert into tblRunCounterChanges ( field1, field2, etc, etc... )

select * from TABLE where {openordrecid} not in ( 

select {openordrecid} from tblRunCounterChanges)
if I'm NOT reading this post right, the entire query would look like this:
PHP:
insert into tblRunCounterChanges ( field1, field2, etc, etc... )

select * from TABLE where {{{openordrecid} not in ( 

select {openordrecid} from tblRunCounterChanges)} OR {

{Ack_Date} <> (

select {Ack_Date} from tblRunCounterChanges where

{openordrecid} = {openordrecid})} OR {

{Ack_Date} <> (

select {Resch_Date} from tblRunCounterChanges where

{openordrecid} = {openordrecid})} OR {

{Ack_Date} <> (

select {Ord_qty} from tblRunCounterChanges where

{openordrecid} = {openordrecid})}}
 
Last edited:

Users who are viewing this thread

Back
Top Bottom