Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

import from VFP 1

Status
Not open for further replies.

whateveragain

Programmer
Apr 20, 2009
92
US
I'm importing tables from VFP. It works fine except decimal columns with a value of 100.00 are importing as 0.00. Is there a way to prevent this? I'm doing the wizard import thru the Import and Export menu using SQL 2008 on a Vista OS.
 
How the field is defined in VFP and what it is in SQL Server? Try defining bigger scale in SQL Server.
 
It is defined as neumeric in VFP 4 integer places and 1 decimal. In MS SQL 2008, I set the precision to 9 with 6 scale.
 
I've dealt with the same problem. Vfp doesn't handle date the same as SQL. Usually VFP works with a regular date field not a datetime field. The code I use is as follows:

mdate=dtoc(thedate) - Converts date to a string

convert(datetime, '"+mdate+" 00:00:00')

You can't get the exact time because it usually isn't there.

If the field is a datetime field in VFP I would use the TTOC function, but it would probably take more work because of how it would be reported.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top