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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I access a View within a View?

Status
Not open for further replies.

ShopSleep

Programmer
May 24, 2004
3
US
Hi and help!

I created a simple remote view that gets all orders from a SQL orders table according to a date passed to the view. This works fine. Now I need to take the results from that view and use those results in another view to get the addresses of those customers I found placed orders in the first view. I'm using the view designer to create these views as I am horrible at SQL statements. I want to be able to add the first view to the second the same way I can add a table to the view. Is this possible - in our outside the view designer?

Thanks.

Jill
 
It is possible. Select the Add Table option on the shortcut menu in the View Designer. This brings up the Add Table or View dialog. Over to the lower right side is the Table/View option group. Select View and your views will be available in the list.

This said, it is not a recommended practice. I have seen wierd results in the past, but I have not tried it in so long that it could be better today. If you do take this approach you definitely want to make sure the database!view syntax is used in the from clause so VFP can find the view no matter what database is the current database.

It sounds like all you need to do is join in another table or two to get the results you are looking for and it is quite possible to query the records all in one view. I say this without all your requirements, so indeed it might take multiple queries. If you can do it in one view and the performance is not a factor, it probably is better to take that approach.

_RAS
VFP MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top