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.

Recommended Answers

All 2 Replies

you can always do that , just use sysdate that will handle your date problem.

You can use this to get current date at midnight.

Select to_char (trunc(SYSDATE), 'MM-DD-YYYY HH:MI:SS') from dual;

Just google Oracle Date functions if you want something more specific.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.