Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating SQL Server from VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
01035892
Message ID:
01035947
Vues:
14
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform