Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weird select
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Weird select
Miscellaneous
Thread ID:
00145048
Message ID:
00145048
Views:
107
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
Bud Wheeler
Vision Data Solutions, Inc.
Microsoft Partner

http://www.visionpace.com
Http://www.BudWheeler.com
Next
Reply
Map
View

Click here to load this message in the networking platform