Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP Date to SQL DateTime
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01205160
Message ID:
01205471
Views:
17
Hi Sergey
I get no error code back.. and it creates the records ok

Code is below and Doc_Date is a Dtae Time field in SqlServer
   myn = SqlExec(lnHandle,"Insert into Docs " +;
                      "(Doc_ref, Doc_Type, Doc_from, Doc_to, Doc_Compan, Doc_Claim, Doc_MeetWi,;
                       Doc_MeetAr, Doc_Subjec, Doc_Contac, Doc_Contnu, Doc_Safepa, Doc_Comm, Doc_relat,;
                       Doc_Transm,Doc_Val,Doc_date)" + ;
      " VALUES('" + F01 + "','" + F03 + "','" + F04 + "','"  + F05  + "','" + F06  + "','"  + F07 + "','" +;
                    F08 + "','" + F09 + "','" + F10 + "','"  + F14  + "','" + F15  + "','"  + F16 + "','" +;
                    F17 + "','" + F19 + "','" + F20 + "'," + STR(F18,10,2)  + "," +;
                    DTOC(DATE()) +;
                    ")")
>Hi Gerard,
>
>What error did you get with SPT parameter? What code do you use to create INSERT statement?
>
>>I have now got all fields, apart from date fields , populating Sql server ok.
>>When Inserting the Date field, I've used Dtoc() (the ? was giving an error)
>>It creates the record succssfully for good source dates but the date ending up in Sql server table os 01/01/1900 12:00
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform