I have the following select that is acting wierd. It drops a record. The clihist table has two records that are identical. If I break this into two selects I get both records. As a union I only get one of the records.
Any ideas on why this would happen? Does union have an implied DISTINCT statement?
TIA
****************************
ldDate = {10/06/1998}
lcClientnamespace = space(30)
lcFname = space(20)
lcLname = space(20)
lcEmpId = space(10)
lnstot = 000000.00
lnptot = 000000.00
lcticketTable = "Temp"
SELECT ldDate AS AppDate, ;
lcClientNameSpace AS ClientName, ;
lcfname AS cfname, ;
lclname AS clname, ;
lcEmpid AS Id, ;
lnstot AS sertot, ;
lnptot AS protot, ;
clihist.empnum, ;
clihist.tagid, ;
clihist.description AS descript, ;
clihist.item, ;
clihist.total ;
FROM clihist ;
WHERE ( clihist.date = ldDate AND clihist.CANCEL = .f. ) ;
union ;
SELECT ldDate AS AppDate, ;
lcClientNameSpace AS ClientName, ;
lcfname AS cfname, ;
lclname AS clname, ;
lcEmpid AS Id, ;
lnstot AS sertot, ;
lnptot AS protot, ;
prodhist.empnum, ;
prodhist.tagid, ;
prodhist.description AS descript, ;
prodhist.item, ;
prodhist.total ;
FROM prodhist ;
WHERE ( prodhist.date = ldDate AND prodhist.CANCEL = .f.) ;
INTO TABLE (lcTicketTable) ;
ORDER BY 8,9
browse last nowait