Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9278461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:22:38+00:00 2026-06-18T17:22:38+00:00

Assuming this has a simple solution, but I can’t find it. I’m trying to

  • 0

Assuming this has a simple solution, but I can’t find it.

I’m trying to do some logic on a DATE field in Oracle. My desire is to take a DATE field and subtract X hours from it.

For instance: SELECT A.MyDATE - 100 Hours from dual;

however, I need a result in a timestamp format ‘YYYY-MM-DD hh:mm’.

I’ve tried CAST(A.MyDATE as TIMESTAMP) - NUMTODSINTERVAL(100/24,'day') however it didn’t work.

I found out that the issue is that the MyDATE field when cast to a timestamp still contained some residual time elements. How can I reset these??

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T17:22:40+00:00Added an answer on June 18, 2026 at 5:22 pm

    You can just do this with subtraction:

    select a.MyDate - 100.0/24
    

    To convert to varchar:

    select to_char(a.MyDate - 100.0/24, 'YYYY-MM-DD')
    

    And, if you want to get rid of that pesky time on the date:

    select trunc(a.MyDate - 100.0/24) as JustTheDate
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This probably has a simple answer, but I must not have had enough coffee
I've recently taken over a project from another consulting firm. I'm assuming this can
LinkedIn has this cool feature in which while visiting some user's profile, LinkedIn prompts
This has got to be simple -- surely this method is supposed to work
Consider this simple model, where a Project has one ProjectType and, naturally many Projects
I apologize if this has been answered, I've searched for some time and could
Just created an acc on SO to ask this :) Assuming this simplified example:
I am missing this DLL reference in c:\program files\SQL Server\90\Tools\Binn. I'm assuming that this
Are there any way to access or set iphone's alarm? Im assuming if this
Assuming I have this HTML structure: <ul class='menu'> <li> <div></div> <div> <div></div> <div> <a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.