Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert - SQL For DateTime Data Type
Message
From
21/11/2001 04:37:50
 
 
To
21/11/2001 02:07:07
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00584335
Message ID:
00584345
Views:
28
>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
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform