Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert with a date
Message
 
À
31/05/2006 14:05:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01126253
Message ID:
01126259
Vues:
17
>when i do and insert in a table i do it this way
>
>TEXT TO SQLCOMMAND NOSHOW PRETEXT 7
>     	INSERT INTO TB_ARINV (TR_ZEBRAINVID,TR_DUEDTE)
>     VALUES (<<ARINV.ZEBRAINVID>>,'<<ARINV.DUEDTE>>')
>ENDTEXT
>
>the arinv.duedte is a date. so if the date is 08/08/2006 it will be ok in the sql server but i will have 12:00:00 for the hours. there is a way to skip this part ???

As Borissov stated you will have the 12:00:00 tacked onto the date in SQL Server.

Here is an example of a way to convert SQL Server Dates for use within a VFP Select statement:
ldDate = Thisform.cntStartDate.txtDate.Value

ldDate = CTOD(ldDate)

ltDateTime = DTOT(ldDate+1) – 1

SELECT * ; 
	FROM cuDetail ;
	WHERE cuDetail.CreatedDate <= ltDateTime ;
	into cursor cuCumulativeTotal 
	
Tom
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform