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:
01035950
Views:
13
There's no need to convert date to datetime in this case. SPT will do it for you. Also DTOT() could do such conversion, if neccessary.

>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
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform