Steve-vfp9user
Programmer
Hello
I am trying to add records from several tables to a SYS(2015) file that meet a certain criteria:
This works as expected
If I issue the below from a different table it
removes the above records but adds the ones below:
I have tried the first line and then replaced the second line with the below
which works but then the dates are not in the order they should be CAEXPREP records:
My question is, how do I insert records matching the relevant criteria (MASTLINK=mmastlink)
and show the records in their respective order (these are UK date format) as below:
From CAACTIVITY
20/06/2023
21/07/2023
01/08/2023
etc....
Then:
From CAEXPREP
16/06/2023
21/06/2023
04/08/2023
etc....
The help file shows a command called INSERT but it doesn't like (ALL)
Any guidance would be appreciated.
Thank you
Steve Williams
VFP9, SP2, Windows 10
I am trying to add records from several tables to a SYS(2015) file that meet a certain criteria:
Code:
* Using mmastlink=525 as an example
USE CAACTIVITY SHARED
COPY STRUCTURE TO tempfile+'.dbf'
SELECT * FROM CAACTIVITY WHERE MASTLINK=mmastlink ;
ORDER BY ACTDATE INTO TABLE tempfile+'.dbf'
This works as expected
If I issue the below from a different table it
removes the above records but adds the ones below:
Code:
SELECT * FROM CAEXPREP WHERE MASTLINK=mmastlink ;
ORDER BY ACTDATE INTO TABLE tempfile+'.dbf'
I have tried the first line and then replaced the second line with the below
which works but then the dates are not in the order they should be CAEXPREP records:
Code:
APPEND FROM CAEXPREP FOR MASTLINK=mmastlink
My question is, how do I insert records matching the relevant criteria (MASTLINK=mmastlink)
and show the records in their respective order (these are UK date format) as below:
From CAACTIVITY
20/06/2023
21/07/2023
01/08/2023
etc....
Then:
From CAEXPREP
16/06/2023
21/06/2023
04/08/2023
etc....
The help file shows a command called INSERT but it doesn't like (ALL)
Code:
INSERT INTO tempfile+'.dbf' (ALL) ;
SELECT * FROM CAEXPREP ;
WHERE MASTLINK=mmmastlink
Any guidance would be appreciated.
Thank you
Steve Williams
VFP9, SP2, Windows 10