Collections:
Increment Dates by 1 in Oracle
How To Increment Dates by 1 in Oracle?
✍: FYIcenter.com
If you have a date, and you want to increment it by 1. You can do this by adding the date with a date interval. You can also do this by adding the number 1 directly on the date. The tutorial example below shows you how to adding numbers to dates, and take date differences:
SELECT TO_DATE('30-APR-06') + 1 FROM DUAL;
-- Adding 1 day to a date
01-MAY-06
SELECT TO_DATE('01-MAY-06') - TO_DATE('30-APR-06')
FROM DUAL;
-- Taking date differences
1
SELECT SYSTIMESTAMP + 1 FROM DUAL;
-- The number you add is always in days.
08-MAY-06
SELECT TO_CHAR(SYSTIMESTAMP+1,'DD-MON-YYYY HH24:MI:SS.FF3')
FROM DUAL;
-- Error: Adding 1 to a timestamp makes it a date.
⇒ Date and Time Differences in Oracle
⇐ Concatenate Two Text Values in Oracle
2020-03-15, 3371🔥, 0💬
Popular Posts:
What Is Program Global Area (PGA) in Oracle? A Program Global Area (PGA) is a memory buffer that is ...
Where to find answers to frequently asked questions on Conditional Statements and Loops in SQL Serve...
How To Get a List of All Tables with "sys.tables" View in SQL Server? If you want to see the table y...
How To Use GO Command in "sqlcmd" in SQL Server? "sqlcmd" is a command line client application to ru...
What is dba.FYIcenter.com Website about? dba.FYIcenter.com is a Website for DBAs (database administr...