Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UNION incompatability
Message
From
18/06/2014 08:41:19
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
17/06/2014 15:46:13
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01602005
Message ID:
01602031
Views:
46
It seems you use VFP 9, so you can use the CAST function. For older versions, you can use one of the following (to convert to currency):

... NumericField * $1 AS CurrencyField ...
... ntom(NumericField) AS CurrencyField ...


>Hi All:
>
>How do I fix the following to make it UNION compatible? It's not compatible since one field is numeric and the other is currency. This is just a scaled-down example. In the real system, I'm not able to change the definition of Currency in File1.
>
>
>CLOSE ALL
>
>CREATE TABLE ('file1') ;
>	(fname C(30), ;
>	extprice    Y)
>	
>CREATE TABLE ('file2') ;
>	(fname   c(30))	
>	
>SELECT fname, extprice ;
>FROM file1 ;
>union all ;
>SELECT fname, 000000.00 as extprice ;
>FROM file2 ;
>INTO CURSOR blarg
>
>
>Thanks,
>
>Yossi
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform