| | |
INSERT sql statement for DateTime
Please support our Oracle advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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.
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
0
#3 Oct 16th, 2009
You can use this to get current date at midnight.
Just google Oracle Date functions if you want something more specific.
sql Syntax (Toggle Plain Text)
SELECT to_char (trunc(SYSDATE), 'MM-DD-YYYY HH:MI:SS') FROM dual;
Just google Oracle Date functions if you want something more specific.
![]() |
Similar Threads
- MS ACCESS SQL statement help! (Java)
- SQL statement help! (Visual Basic 4 / 5 / 6)
- help with an sql statement (MS SQL)
- Question about SQL statement (MS SQL)
- SQL statement error (ASP.NET)
- sql statement (Visual Basic 4 / 5 / 6)
- run sql statement in asp (ASP)
Other Threads in the Oracle Forum
- Previous Thread: trigger help pls....!!!!
- Next Thread: PL/SQL: ORA-00922: missing or invalid option
| Thread Tools | Search this Thread |
2009predictions acquisition amazon.com bartz bernanke cia citrix cloudcomputing crm database dell economy editor enterprise enterprise2.0 enterprisesoftware federalreserve forbes hp ibm intellipedia internet larryellison layoffs linux loughridge mediawiki michaeljackson microsoft neverland nortel notebooks oil operatingsystem oracle palm rimm saas salesforce sap seagate socialcomputing sql sun sybase technologystocks virtualiron virtualization vmware wiki wikipedia xen yahoo zoho






