INSERT sql statement for DateTime

Reply

Join Date: Nov 2007
Posts: 53
Reputation: dotNetDummi is an unknown quantity at this point 
Solved Threads: 0
dotNetDummi's Avatar
dotNetDummi dotNetDummi is offline Offline
Junior Poster in Training

INSERT sql statement for DateTime

 
0
  #1
Oct 15th, 2009
Hi all,

Is it possible to insert a SQL statement where I specify the time, and not the date. I do need the date, but I want it to be the current date when I run the insert statement. The time got to be fixed.

For example,
Insert into xxx
Values(current_date + '12:00:00');

Anyone have any idea if SQL allows this?

I look forward to your reply.
Thanks in advance.
Serene Joey
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,103
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 128
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic
 
0
  #2
Oct 16th, 2009
you can always do that , just use sysdate that will handle your date problem.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 118
Reputation: cgyrob is on a distinguished road 
Solved Threads: 18
cgyrob's Avatar
cgyrob cgyrob is offline Offline
Junior Poster
 
0
  #3
Oct 16th, 2009
You can use this to get current date at midnight.

  1. SELECT to_char (trunc(SYSDATE), 'MM-DD-YYYY HH:MI:SS') FROM dual;

Just google Oracle Date functions if you want something more specific.
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the Oracle Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC