>Is it possible to use a subquery to return the KeyID of a newly INSERTed record? Something like this:
>
>
>select max(keyid) from (insert into tip (st_name) values ('test'))
>
>What would be the syntax?
>Thanks
Nope,
To use derived tables the commands must returns result set. INSERT and DELETE commands didn't do that.
So you must separate these commands in two different queries.
BTW what version of VFP and what s the type of KeyID field (is it AUTOINC or not?)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.