Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Rick C. Hodgin
  Where is Rick C. Hodgin?
 Indiana - United States
 Rick C. Hodgin
 To: Noel Cris
  Where is Noel Cris?
 Lipa City
 Noel Cris
Subject: RE: query integer to double
Thread ID: 373874 Message ID: 373882 # Views: 37 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Thursday, March 28, 2013 1:58:28 PM         

> > Did you use
> > SELECT CAST(column AS Double) FROM .. ?
> Didn't work.
> This is as far as I can get:
> select CAST(column*1.00 as decimal(15,0)) as newval from mysql.table
> which return a numeric(16,0) in VFP and not double as desired.

If you create a remote view it gives you the option to interpret the remote field as an alternate type. For IBM DB2's datetime equivalent field, for example, we always cast it as a C(26) because it was formatted as "YYYY/MM/DD HH:MM:SS.123456" internally. By default it came over as datetime and lost some of its precision.

Even if you can't use remote views in this way, you might be able to create a remote view to look at (and then delete). Examine its SQL code and see what settings it's using internally to create that data condition. Maybe it's only a passthrough setting in the driver. I don't know.

In my experience, the suggestion Anders gives you is correct. Casting values like that returns proper forms. I'm not sure what the cause of your error is.

Best regards,
Rick C. Hodgin


query integer to double Posted by Noel Cris @ 3/28/2013 10:05:33 AM
RE: query integer to double Posted by Anders Altberg @ 3/28/2013 12:42:02 PM
RE: query integer to double Posted by Noel Cris @ 3/28/2013 1:03:50 PM
RE: query integer to double Posted by Rick Hodgin @ 3/28/2013 1:58:28 PM