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

Click here to load this message in the networking platform