Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert with a date
Message
 
To
31/05/2006 14:05:33
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01126253
Message ID:
01126259
Views:
18
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform