Loading topic
SYSDATE is the function you reach for first when a query depends on "now". This chapter covers what it returns, how it differs from the other current-time functions, and the pitfalls that produce wrong results in reports, defaults, and tests.6 min read+ and - is the foundation for the month functions later in the tutorial.5 min readDATE stores a time of day along with the calendar date. It also assumes you can add days to a DATE and call SYSDATE. Here you will learn how TRUNC removes the time portion, where that helps, and where it hurts.6 min readDATE always carries a time of day and that SYSDATE returns the current server date and time. It also assumes you can add whole days with date + n. You should be comfortable with SELECT ... FROM dual and TO_CHAR for display.5 min readSELECT queries, use the DUAL table, and call ADD_MONTHS for simple cases. It covers the one part of ADD_MONTHS that surprises people: what happens when the starting date is at or near the end of a month.5 min readADD_MONTHS and its month-end rule. MONTHS_BETWEEN is the inverse question: given two dates, how many months apart are they?5 min readMONTHS_BETWEEN result and what rule produces it. It assumes you have read the previous chapters on DATE values, ADD_MONTHS, and its end-of-month behavior.5 min readSYSDATE, TRUNC, ADD_MONTHS, and MONTHS_BETWEEN from earlier chapters, including the end-of-month rule and the 31-day rule for 5 min readSYSDATE, day arithmetic, plain TRUNC(date), ADD_MONTHS, and MONTHS_BETWEEN. The three functions here fill the gaps those tools leave. They find month boundaries, find the next occurrence of a weekday, and snap a date to the 5 min readDATE, SYSDATE, ADD_MONTHS, and MONTHS_BETWEEN. You should also be comfortable with TRUNC and half-open date range filters. Here you compare those tools with Oracle's TIMESTAMP and INTERVAL types and learn when each is the bette5 min read