johnf wrote:
> I am displaying a table on a grid that contains several FK keys and I want
> the
> description (in the FK table) to display in the grid.
>
> In VFP I would just set the relationships in the data evironment. But I
> don't see how I can do this in Dabo?
>
> So in my table I have:
> fk_A = the pkid in FK_tableA
> fk_B=the pkid in FK_tableB
>
> FK_tableA:
> pkid
> description
>
> FK_tableB:
> pkid
> description
>
> Any suggestions would be helpful.
Modify your SQL statement to pull the descriptions into the result set. IOW:
select main.pkid as pkid,
main.fk_a as fk_a,
main.fk_b as fk_b,
table_a.description as a_description,
table_b.description as b_description
from main
left join table_a
on table_a.pkid = main.fk_a
left join table_b
on table_b.pkid = main.fk_b
--
pkm ~ http://paulmcnett.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]