Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating SQL Server from VFP
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
01035892
Message ID:
01035947
Views:
16
As Jim said the problem is with DATE(), you must convert the date to datetime, If you didn't care about time portion it is easier, but if you want the exact datetime for furter calculations uyou must add zeroes there:
mystr = "Insert into mastcust (masterref,amenddate) values('0000000001',?m.mydate)"
sqlprepare(handle,mystr) && Ok so far

***m.mydate = date()
** If you didn't care about time portion, the DATE portion of this field is used only for info
m.mydate = DATETIME()
** but if the DATE portion of this field is used for some calculations:
m.mydate = DATETIME(YEAR(DATE(), MONTH(DATE(), DAY(DATE(),0,0,0)
retval = sqlexecute(handle)
IF retval < 0
   AERROR(arError)
   DISPLAY MEMO LIKE arError
ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform