Skip to main content
PHP Blog

Back to all posts

How to Get the Previous Working Day From Oracle?

Published on
3 min read
How to Get the Previous Working Day From Oracle? image

Best Oracle Date Functions to Buy in October 2025

1 Messy Truth Oracle, Oracle Cards for Beginners, 54 Cards Deck for Love Relationship Clarity, Emotional Healing and No-Contact Reflection, Straight-Talking Cards for Shadow Work and Self-Empowerment

Messy Truth Oracle, Oracle Cards for Beginners, 54 Cards Deck for Love Relationship Clarity, Emotional Healing and No-Contact Reflection, Straight-Talking Cards for Shadow Work and Self-Empowerment

  • EMBRACE THE MESS: FACE EMOTIONAL CHAOS WITH BRUTAL HONESTY.
  • MODERN LOVE INSIGHTS: NAVIGATE TODAY'S COMPLEX RELATIONSHIPS EFFORTLESSLY.
  • THOUGHTFUL GIFTING: BEAUTIFULLY PACKAGED FOR ANYONE ON A GROWTH JOURNEY.
BUY & SAVE
$13.59 $16.99
Save 20%
Messy Truth Oracle, Oracle Cards for Beginners, 54 Cards Deck for Love Relationship Clarity, Emotional Healing and No-Contact Reflection, Straight-Talking Cards for Shadow Work and Self-Empowerment
2 Trikendou The Truth Oracle Cards Deck, Revealing The Truth of Life, Love, Past, Now, Future Oracle Cards for Beginner with meanging on Them

Trikendou The Truth Oracle Cards Deck, Revealing The Truth of Life, Love, Past, Now, Future Oracle Cards for Beginner with meanging on Them

  • UNIQUE 54-CARD DECK FOR EXCLUSIVE INSIGHTS AND DAILY GUIDANCE.

  • DIVE DEEPER INTO LIFE’S QUESTIONS WITH VERSATILE CARD MEANINGS.

  • PREMIUM, DURABLE CARDS ENSURE LONG-LASTING USE FOR EVERY READING.

BUY & SAVE
$9.99 $11.99
Save 17%
Trikendou The Truth Oracle Cards Deck, Revealing The Truth of Life, Love, Past, Now, Future Oracle Cards for Beginner with meanging on Them
3 Neon Love Oracle Deck: A Modern Dating and Relationship Oracle - Reveal Secrets, Test Compatibility, Find True Love - Romance Cards With Meanings for Beginners to Advanced Readers

Neon Love Oracle Deck: A Modern Dating and Relationship Oracle - Reveal Secrets, Test Compatibility, Find True Love - Romance Cards With Meanings for Beginners to Advanced Readers

  • UNLOCK RELATIONSHIP SECRETS WITH THE NEON LOVE ORACLE DECK!
  • EASY-TO-USE CARDS REVEAL LOVE'S TRUE POTENTIAL AND COMPATIBILITY.
  • PERFECT ICEBREAKER FOR DATES: DIVE INTO HONEST, FUN LOVE INSIGHTS!
BUY & SAVE
$15.95 $16.95
Save 6%
Neon Love Oracle Deck: A Modern Dating and Relationship Oracle - Reveal Secrets, Test Compatibility, Find True Love - Romance Cards With Meanings for Beginners to Advanced Readers
4 DPEHAKMK Clarifying Life Situations Oracle Cards, Love and Career Oracle Deck for Beginners, Cover All Areas in Life, Love, Spiritual Journey, and Career

DPEHAKMK Clarifying Life Situations Oracle Cards, Love and Career Oracle Deck for Beginners, Cover All Areas in Life, Love, Spiritual Journey, and Career

  • UNLOCK INSIGHTS INTO LOVE, CAREER, AND YOUR SPIRITUAL JOURNEY.
  • 80 UNIQUE CARDS DESIGNED FOR PERSONAL GROWTH AND CLARITY.
  • PERFECT FOR FAMILY GATHERINGS AND FUN WITH FRIENDS YEAR-ROUND!
BUY & SAVE
$13.59 $16.99
Save 20%
DPEHAKMK Clarifying Life Situations Oracle Cards, Love and Career Oracle Deck for Beginners, Cover All Areas in Life, Love, Spiritual Journey, and Career
5 Qymagicz Embracing The Shadow Oracle Deck, Emotional Healing Oracle Cards for Beginners, Personal Growth, Spiritual Guidance, Dark Situation Reflection

Qymagicz Embracing The Shadow Oracle Deck, Emotional Healing Oracle Cards for Beginners, Personal Growth, Spiritual Guidance, Dark Situation Reflection

  • EMBRACE YOUR UNIQUENESS-NO MORE APOLOGIES FOR BEING YOU!

  • NO GUIDEBOOK REQUIRED; MEANINGS PRINTED ON EACH CARD FOR EASE.

  • PERFECT GIFT FOR SELF-DISCOVERY, HEALING, AND CONNECTING WITH OTHERS!

BUY & SAVE
$16.99
Qymagicz Embracing The Shadow Oracle Deck, Emotional Healing Oracle Cards for Beginners, Personal Growth, Spiritual Guidance, Dark Situation Reflection
6 GZXINKE Cosmic Oracle Cards, Universe Message Oracle Cards for Beginners, Inner Strength, Spiritual Guidance Oracle Deck, Universal Wisdom for Daily Use, Readings, and Meditation

GZXINKE Cosmic Oracle Cards, Universe Message Oracle Cards for Beginners, Inner Strength, Spiritual Guidance Oracle Deck, Universal Wisdom for Daily Use, Readings, and Meditation

  • TRUST THE UNIVERSE: NAVIGATE UNCERTAINTIES WITH COSMIC ORACLE CARDS.

  • UPLIFT YOUR SPIRIT: 54 CARDS FOR CLARITY, STRENGTH, AND SELF-DISCOVERY.

  • PERFECT GIFT: THOUGHTFUL PACKAGING FOR ANY SPIRITUALITY ENTHUSIAST!

BUY & SAVE
$9.99
GZXINKE Cosmic Oracle Cards, Universe Message Oracle Cards for Beginners, Inner Strength, Spiritual Guidance Oracle Deck, Universal Wisdom for Daily Use, Readings, and Meditation
+
ONE MORE?

To get the previous working day from an Oracle database, you can use the TRUNC function to remove the time portion of a date, and then use the CASE statement to check if the previous day is a Saturday or Sunday. If it is, you can return the previous business day by subtracting an additional day. Finally, you can use the result in your query to retrieve data related to the previous working day from the database.

How to find the date of the previous working day in Oracle SQL?

To find the date of the previous working day in Oracle SQL, you can use the following query:

SELECT CASE WHEN TO_CHAR(sysdate - 1, 'DY', 'NLS_DATE_LANGUAGE=ENGLISH') IN ('SAT', 'SUN') THEN sysdate - 1 ELSE sysdate - 1 END AS previous_working_day FROM dual;

In this query, sysdate - 1 is the date of the previous day. The CASE statement checks if the previous day is a Saturday or Sunday (non-working days) and if so, it subtracts an additional day to get the previous working day. Finally, the result is displayed as previous_working_day.

What is the formula to get the previous working day in Oracle?

To get the previous working day in Oracle, you can use the following formula:

SELECT CASE WHEN to_char(sysdate - 1, 'DY', 'NLS_DATE_LANGUAGE=ENGLISH') = 'SAT' THEN sysdate - 2 WHEN to_char(sysdate - 1, 'DY', 'NLS_DATE_LANGUAGE=ENGLISH') = 'SUN' THEN sysdate - 3 ELSE sysdate - 1 END AS previous_working_day FROM dual;

This formula calculates the previous day of the current date and checks if it falls on a Saturday or Sunday. If it does, it adjusts the date accordingly to get the previous working day.

What is the formula to determine the previous working day in Oracle database?

To determine the previous working day in Oracle database, you can use the following formula:

SELECT CASE WHEN TO_CHAR(SYSDATE, 'DY', 'NLS_DATE_LANGUAGE = American') = 'MON' THEN TRUNC(sysdate - 3) ELSE TRUNC(sysdate - 1) END AS previous_work_day FROM dual;

This formula checks if the current day is Monday, then subtracts 3 days to get the previous Friday. Otherwise, it subtracts 1 day to get the previous working day.

What is the function to find the last working day in Oracle SQL?

There isn't a built-in function in Oracle SQL to directly find the last working day of the month. However, you can achieve this by using a combination of functions such as LAST_DAY to get the last day of the month and TO_CHAR to get the day of the week.

Here's an example query to find the last working day of the month in Oracle SQL:

SELECT LAST_DAY(SYSDATE), TO_CHAR(LAST_DAY(SYSDATE), 'DAY') AS day_of_week, CASE WHEN TO_CHAR(LAST_DAY(SYSDATE), 'DAY') IN ('SATURDAY', 'SUNDAY') THEN LAST_DAY(SYSDATE) - 1 ELSE LAST_DAY(SYSDATE) END AS last_working_day FROM dual;

In this query, SYSDATE is used to get the current date, LAST_DAY is used to get the last day of the month, TO_CHAR is used to get the day of the week, and a CASE statement is used to check if the last day of the month is a Saturday or Sunday, and if so, subtracts a day to get the last working day.

What is the query to find yesterday's date excluding weekends in Oracle?

To find yesterday's date excluding weekends in Oracle, you can use the following query:

SELECT CASE WHEN TO_CHAR(SYSDATE-1, 'Dy') = 'Sun' THEN SYSDATE-2 WHEN TO_CHAR(SYSDATE-1, 'Dy') = 'Mon' THEN SYSDATE-3 ELSE SYSDATE-1 END AS yesterday_excluding_weekends FROM dual;

This query will check if yesterday's date is a Sunday or Monday, and adjust the date accordingly to skip the weekend.