VFP9- SQL with UNION

2008-07-23 Thread Sytze de Boer
Folk, I'm stuck I'm trying to extract data from 3 seperate tables as follows Select date,stockcode,stktype,invnum,SUM(qty) ,sell,desc, H as SRCE From winhst Where stktype=333 UNION ; Select date,stockcode,stktype,invnum,SUM(qty) ,sell,desc, J as SRCE From wintime Where stktype=333 UNION ; Select

Re: VFP9- SQL with UNION

2008-07-23 Thread Paul Hill
On Wed, Jul 23, 2008 at 7:32 AM, Sytze de Boer [EMAIL PROTECTED] wrote: Folk, I'm stuck I'm trying to extract data from 3 seperate tables as follows Select date,stockcode,stktype,invnum,SUM(qty) ,sell,desc, H as SRCE From winhst Where stktype=333 UNION ; Select

RE: VFP9- SQL with UNION

2008-07-23 Thread Dave Crozier
Sytze, Use Union all not union. The union on its own removes duplicate records. Dave Crozier -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sytze de Boer Sent: 23 July 2008 07:32 To: profox@leafe.com Subject: VFP9- SQL with UNION Folk, I'm stuck I'm

Re: VFP9- SQL with UNION

2008-07-23 Thread Garrett Fitzgerald
I thought of that, but they aren't dup records: he's adding the SRCE column so the data in each query is different. On Wed, Jul 23, 2008 at 03:21, Dave Crozier [EMAIL PROTECTED] wrote: Use Union all not union. The union on its own removes duplicate records. -Original Message- From:

Re: VFP9- SQL with UNION

2008-07-23 Thread Ted Roche
On Wed, Jul 23, 2008 at 2:32 AM, Sytze de Boer [EMAIL PROTECTED] wrote: Folk, I'm stuck I'm trying to extract data from 3 seperate tables as follows Select date,stockcode,stktype,invnum,SUM(qty) ,sell,desc, H as SRCE From winhst Where stktype=333 UNION ; Select