Question

Asked on 2009-08-04 at 03:43:28ID: 25489205

Remove time from Oracle datetime in query

by: cjohnson300500

Rating8.5Very Good

Is it possible to remove the time from a date field in an Oracle query so that it retains the ability to sort by date?  

If I use to_char it doesn't sort properly and I can't get trunc and to_date to remove the date

Many thanks in advance

  1. How to get return date from Oracle?
    Need a query or procedure that if its before noon return yesterday's date else return today's date
  2. Date and Time in sql
    i am douting i want to return Date and Time should consider it as a string ?
  3. Extracting data from Oracle based on date and time
    I am trying to extract data from Oracle 8i based on date and time Sytax of my query is as follows... select LastOccurrence from REPORTER_STATUS where to_date(LastOccurrence, 'DD-MON'YY HH24:MI:SS') >= to_date('04-JAN-06 08:00:00', 'DD-MON-YY HH24:MI:SS') and to_date(LastOccurr…
  4. Converting a field from date/time to just date (m…
    Hi I am trying to create a table from another table (source table). The source table has dates with date and time. I want my table to only contain the date only (no time). I am running this sequel in ORACLE using the TOAD query builder.
  5. Getting a Date from a DATE column in ORACLE 9i
    Sir, I am working in C#.NET and using ORACLE 9i as a backend database. The problem is that I stored an entry date in the database. But when I see the contents, it gives date and time. How can i only get date from that column? I have attached the screen shot of DATE column.

Solution

Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.

About this Solution
View This Solution - Start Your 30 Day Free Trial
Zone
General
Tags
Oracle date time
Participating Experts
6
Solution Grade
A

Replies

 by:

Posted on 2009-08-04 at 03:46:11ID: 28404012

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: angelIII

Posted on 2009-08-04 at 03:46:28ID: 28404013

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: itkamaraj

Posted on 2009-08-04 at 03:48:28ID: 28404014

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: cjohnson300

Posted on 2009-08-04 at 04:11:36ID: 28404015

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: angelIII

Posted on 2009-08-04 at 04:13:19ID: 28404016

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: Milleniumaire

Posted on 2009-08-04 at 04:13:36ID: 28404017

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: cjohnson300

Posted on 2009-08-04 at 04:37:39ID: 28404018

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: Milleniumaire

Posted on 2009-08-04 at 04:38:43ID: 28404019

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: cjohnson300

Posted on 2009-08-04 at 04:40:40ID: 28404020

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: angelIII

Posted on 2009-08-04 at 04:47:12ID: 28404021

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: cjohnson300

Posted on 2009-08-04 at 04:52:19ID: 28404022

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: Milleniumaire

Posted on 2009-08-04 at 04:52:54ID: 28404023

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: angelIII

Posted on 2009-08-04 at 05:00:13ID: 28404024

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: shru_0409

Posted on 2009-08-04 at 05:15:17ID: 28404025

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: Milleniumaire

Posted on 2009-08-04 at 05:20:34ID: 28404026

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: cjohnson300

Posted on 2009-08-04 at 05:55:33ID: 28404027

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: Milleniumaire

Posted on 2009-08-04 at 05:59:52ID: 28404028

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: Milleniumaire

Posted on 2009-08-04 at 06:02:13ID: 28404029

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: cjohnson300

Posted on 2009-08-04 at 06:02:56ID: 28404030

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: shru_0409

Posted on 2009-08-04 at 06:06:44ID: 28404031

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: angelIII

Posted on 2009-08-04 at 06:07:13ID: 28404032

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: Milleniumaire

Posted on 2009-08-04 at 06:08:58ID: 28404033

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: shru_0409

Posted on 2009-08-04 at 06:24:04ID: 28404034

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: Milleniumaire

Posted on 2009-08-04 at 06:35:03ID: 28404035

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: cjohnson300

Posted on 2009-08-04 at 06:37:29ID: 28404036

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: angelIII

Posted on 2009-08-04 at 06:46:47ID: 28404037

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: mrjoltcola

Posted on 2009-08-04 at 07:06:31ID: 28404038

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: mrjoltcola

Posted on 2009-08-04 at 07:07:09ID: 28404039

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: awking00

Posted on 2009-08-04 at 07:36:20ID: 28404040

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: cjohnson300

Posted on 2009-08-07 at 01:25:18ID: 32744092

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

Stay Connected

Oracle Around the Web

The latest Oracle news, tips, and tricks

Oracle Unveils Netra SPARC T3 Servers

New Carrier-Grade Blade and Rackmount Servers Deliver Better Performance, Density and Power Efficiency for the Communications Industry ...

read more

Oracle fixes 21 flaws in Java SE, Java for Business

Oracle is fixing 21 flaws in its Java SE and Java for Business products in its February critical patch update issued this week ...

read more

Obama’s Silicon Valley “Tech Supper”

Why was he there? Who wasn’t invited and why? What did they talk about? Why was he really there? These are the questions being debated ...

read more

Featured Oracle Experts

slightwv

slightwv has answered more than 2,000 Oracle questions and oversees database management within the U.S. Government. Slightwv

sdstuber

A regular presenter at the Collaborate conference, Oracle developer sdstuber is a top expert in PL/SQL and Oracle 9, 10 and 11. sdstuber

Testimonials

What users are saying about our experts

"The Oracle gurus provide answers, solutions and valuable workarounds"

User: schwertner

"Wow! Excellent, valuable explanation. Hats off to you"

User: aseshu70

"Solution worked fantastic and performs excellent! Thanks heaps"

User: klausbrandlhuber

Top Experts

  1. slightwv

    2,000

    0 points yesterday

    Profile

BrowseBecome an Expert