Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace

Status
Not open for further replies.

MdVries

Programmer
Apr 16, 2003
47
NL
MAXDATUM

rol_id max_datum
-------+------------
1 01-01-03
2 03-03-04

========================================================

DOSSIER

rol_id cost_code max_datum
---------+-------------+-----------
1 marc <---- Here
2 piet <---- Here

I want to make an query that filles in DOSSIER.max_datum from the MAXDATUM table.

I think that i must use an replace?
 
Something like this????

REPLACE ALL dossier.rol_datum WITH maxdatum.rol_datum ;
FOR dossier.rec_id == maxdatum.dos_id ;
IN dossier


I get an "Data type mismatch" error.
 
UPDATE dossier;
SET rol_datum = ( SELECT maxdatum.rol_datum;
FROM max_datum;
WHERE maxdatum.dos_id = dossier.rec_id);
WHERE EXISTS;
( SELECT maxdatum.rol_datum;
FROM maxdatum;
WHERE maxdatum.dos_id = dossier.rec_id);



What is wrong? I get a error "Function name is missing ).
 
Not having used v2.6 I'm not sure that you can nest the SELECTs like you're attempting in your query in that version. If you'll settle for some good ole xBase code, the following should work, although I haven't tested it:

select 0
use Maxdatum
index on rol_id to MyIndex
select 0
use dossier
set relation to rol_id into maxdatum
REPLACE ALL dossier.rol_datum WITH maxdatum.rol_datum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top