>Ed in sqlserver the syntax is the same.
>
Again, why ask a T-SQL question in a VFP forum? Think about this - if it's being done outside of VFP, why ask in a VFP forum; if it's in VFP using SPT, then it has to be couched in a SQLPREPARE() or SQLEXEC(), and if it's an RV, then he's talking to it as a VFP table using VFP syntax. Think about the context of the question - either he's lost, he's left out a crucial part of the statement needed to make it work, or he's talking an RV, which behaves as if it were a VFP table.
EOT from my POV.
>>>Hi Ed yungkie is talking about sqlserver no vfp in sql server you should use datetime as string so the insert will be like this:
>>>
>>>INSERT INTO my_Table (fld_character, fld_datetime) ;
>>> VALUES ('this is a test','2001-11-21 04:26:00')
>>>
>>>
>>
>>Then wouldn't he be couching this in a SQLEXEC()? If he's talking in terms of VFP - I had assumed he had an RV and wanted to know how to insert a DateTime in an RV - if he were asking about a pure T-SQL operation, then why ask in the VFP coding, syntax and commands area? It'd be marginal even in the Client/Server area.
>>
>>>>>Dear all,
>>>>>
>>>>>I need help from all of you, 'cause right now i'm stuck with this problem;
>>>>>how can I insert a data to SQL Server, which this data type is DateTime, if
>>>>>the data type is character or numeric the syntax is like this :
>>>>>
>>>>>insert into my_table( fld_character, fld_numeric ) ;
>>>>> values ( 'testing data only', 123456789 )
>>>>>
>>>>>but how if the data type is DateTime ?
>>>>>
>>>>>before and after my many many thank's to you.
>>>>
>>>>The representation of a DateTime in a strict notation format is:
>>>>
>>>>{^yyyy-mm-dd,hh:MM:ss}
>>>>
>>>>Where:
>>>>
>>>>yyyy is the 4 digit year
>>>>mm is the two digit month
>>>>dd is the two digit date
>>>>hh is the two digit hour in 24 hour time notation (eg 1PM = 13)
>>>>MM is the two digit minute
>>>>ss is the two digit seconds
>>>>
>>>>So:
>>>>
>>>>
INSERT INTO my_Table (fld_character, fld_datetime) ;
>>>> VALUES ('this is a test',{^2001-11-21,04:26:00})
>>>>
>>>>>
>>>>>regards,
>>>>>yungkie