General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Hi Mark,
I tried this code you suggested with my tables and fields inserted but it gives the error message:
Function name is missing ).
I tried placing the closed parenthesis in several places although I can't seem to determine why it needs it as there is a corresponding close to every open parenthesis.
select TableA
set order to NameDate && index tag on FieldPersonName + DTOS(SomeDate)
select TableB
set relation to FieldPersonName + DTOS(SomeDate) into TableA
replace all FieldTotal with iif(eof('TableA'), 0, TableA.FieldTotal)
Update TableB set FieldTotal = (select TableA.FieldTotal from TableA where TableA.FieldPersonName + DTOS(SomeDate) in (select FieldPersonName + DTOS(SomeDate) from TableB))
Thanks
Max
>UPDATE: I remember now that you probably can not do this in VFP because >subqueries for an UPDATE - SQL are not supported. You will have to set a >relation between the 2 tables and do a REPLACE:
>select TableA
>set order to NameDate && index tag on FieldPersonName + DTOS(SomeDate)
>select TableB
>set relation to FieldPersonName + DTOS(SomeDate) into TableA
>replace all FieldTotal with iif(eof('TableA'), 0, TableA.FieldTotal)
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only