Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with Union difficulties
Message
From
25/01/2000 17:06:08
 
 
To
25/01/2000 16:55:37
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00322433
Message ID:
00322440
Views:
23
>I have a small prg feeding a report as follows:
>
>select date,amt,desc ;
>from bills;
>union;
>select date,amt,desc ;
>from payments;
>union;
>select date, amt, desc ;
>from adjustments;
>order by 3;
>into cursor temp
>
>The catch is the amt field in payments and adjustments is a 12 position numeric while the amt field in the bills table is a 10 position numeric field. This exact syntax works fine in VFP 6.0 and returns the correct results, but the app is in 2.6 for dos and returns an error "Select's are not Union Compatible". I isolated it to the diffence in field sizes by process of elimination. Any workaround for this other than modifying the table to make the fields the same size? I tried select val(padl(chr(amt),12,0)), but it didn't work. Any ideas why it would work in VFP, but not in 2.6?
>I can change the table, but they are getting huge and would have to change many other things as well.
>

A SWAG, but try making all occurances of amt in your query read instead:

000000000000.00 + amt

to force greater consistent precision. Add extra trailing digits if you need >2 decimal place precisions.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform