If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > type date

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-27-03, 04:31
trilly trilly is offline
Registered User
 
Join Date: Aug 2003
Location: Vicenza(I)
Posts: 21
Red face type date

Hello i've another problem with the type date.
What's the syntax of insert in this type?
I've the table:
film wit the column data_catalogo date and I want to insert a value but I don't say how.
Thank You, Elisa
Reply With Quote
  #2 (permalink)  
Old 08-27-03, 08:35
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: type date

Quote:
Originally posted by trilly
Hello i've another problem with the type date.
What's the syntax of insert in this type?
I've the table:
film wit the column data_catalogo date and I want to insert a value but I don't say how.
Thank You, Elisa
Which DBMS? Oracle, SQL Server, Access, ...?
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #3 (permalink)  
Old 08-28-03, 03:17
trilly trilly is offline
Registered User
 
Join Date: Aug 2003
Location: Vicenza(I)
Posts: 21
Re: type date

Quote:
Originally posted by andrewst
Which DBMS? Oracle, SQL Server, Access, ...?
Oracle 9i,
thank you.
Reply With Quote
  #4 (permalink)  
Old 08-28-03, 05:32
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: type date

Quote:
Originally posted by trilly
Oracle 9i,
thank you.
In that case, you need to use the TO_DATE function with a VARCHAR2 date value and a format mask, e.g.:

insert into mytable( date_col ) values ( TO_DATE('01-SEP-2003','DD-MON-YYYY') );

insert into mytable( date_col ) values ( TO_DATE('01/09/2003','DD/MM/YYYY') );

insert into mytable( date_col ) values ( TO_DATE('2003/09/01 16:42:00','YYYY/MM/DD HH24:MIS') );
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On