>Hi,
>
>Here is my situation:
>
>I am working with 9x9 boxes of blood specimens stored in -80 freezers. The boxes have been consolidated into various new locations in the freezers. Box locations are described by freezer, shelf, rack and position. I want to use the Update - sql command to modify the locations for my boxes in the Box table using the NewLocation table.
>
>I think I am close but something is wrong with my syntax:
>
>
>update Box ;
> set ;
> Box.freezer = NewLocation.freezer, ;
> Box.shelf = NewLocation.shelf, ;
> Box.rack = NewLocation.rack, ;
> Box.position = NewLocation ;
> from NewLocation ;
> where Box.box = NewLocation.box
>
>
>Here is what help says:
>
>
>UPDATE Target
> SET Column_Name1 = eExpression1 [, Column_Name2 = eExpression2 ...]
> [FROM [FORCE] Table_List_Item [[, ...] | [JOIN [ Table_List_Item]]]
> WHERE FilterCondition1 [AND | OR FilterCondition2 ...]
>
>
>
>I am sure it is pretty obvious, let me know if you see my error ...
>
>Thanks!
Carole,
As Fabio already pointed out code was incomplete and "from" would work only in VFP9 and up. In previous versions you can do that with seek() in where clause or with scan..endscan in 'newLocation'.
ie: With scan...endscan approach:
select NewLocation
scan
update Box ;
set ;
Box.freezer = NewLocation.freezer, ;
Box.shelf = NewLocation.shelf, ;
Box.rack = NewLocation.rack, ;
Box.position = NewLocation.Position ;
where Box.box == NewLocation.box
endscan
Cetin