I’m working with an accounting system with a Visual Foxpro backend. Every month, all of the invoices and payments are moved from the current invoices/payments table to a new table (in a different directory) with just that month’s data. For example:
MainDBDir
currentInvoices.dbf (contains Dec invoices)
currentPayments.dbf (contains Dec payments)
2010Dir
NovDir
invoices.dbf (contains Nov2010 invoices)
payments.dbf (contains Nov2010 payments)
OctDir
invoices.dbf (contains Oct2010 invoices)
payments.dbf (contains Oct2010 payments)
I need to execute a queries on the last six months of data. Is there a way I can concatenate multiple tables (from multiple directories) in a single Visual Foxpro query?
I need something like this:
select * from concatenate(currentInvoices, 2010Dir/NovDir/invoices.dbf, 2010Dir/OctDir/invoices) where invoice_number like '12345'
I’d rather not execute a separate query for each table…
Thanks-
Jonathan
You can concatenate the queries by using a union statement.
Example:
or