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 8859087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:58:21+00:00 2026-06-14T14:58:21+00:00

I have a date column whose type is DATE and values are of the

  • 0

I have a date column whose type is DATE and values are of the form 23-AUG-12, 09-FEB-12. Now i am trying to run a query but i am getting error that

ORA-01843: not a valid month
01843. 00000 -  "not a valid month"
*Cause:    
*Action:

Here is the query. Actually i want to get the current date on the right side of first_appr_dt = current date

select LOSA_APP.app_ref_no AS "App.Ref.No." from losa_app LOSA_APP where 
LOSA_APP.app_status='A' and first_appr_dt = 
(SELECT TO_CHAR(SYSDATE, 'MM-DD-YYYY') from dual);

What i am doing wrong ? Please help .

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-14T14:58:22+00:00Added an answer on June 14, 2026 at 2:58 pm

    If the column first_appr_dt is really a DATE column, then there’s no need to to compare the dates as string. In fact, it’s probably the source of the problem.

    Furthermore, there’s no need select from DUAL for this simple expression.

    You rather want:

    select LOSA_APP.app_ref_no AS "App.Ref.No." from losa_app LOSA_APP
    where LOSA_APP.app_status = 'A' and first_appr_dt = trunc(sysdate);
    

    Note, that the query uses TRUNC to remove the time from the date as your table probably contains dates with the time set to 00:00:00. If not, then you should try the following condition:

    trunc(first_appr_dt) = trunc(sysdate)
    

    If you really want to compare the dates as strings, then you would need to use TO_CHAR for both sides of the comparison:

    to_char(first_appr_dt, 'DD-MON-YYYY') = to_char(sysdate, 'DD-MON-YYYY')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Oracle DATE column with, for example, these values: RUN_DATE ------------------- 2012-06-09
I have the holiday table whose description are Name Null? Type HOLIDAYDATE DATE DESCRIPTION
I have a DATE column with a date in it but I need to
I have a DATE column that I want to round to the next-lower 10
I have a date column where the date is displayed in the format 2009-11-18
I have a date column in a data frame in chr format as follows:
ISQL Perform Screen: I have a date column (format=mmm-dd-yyyy) used for storing Date Manufactured.
I have a DATE datatype mysql column in a table. I want to set
I have table with date/time column and person column. Each person has multiple records
I have to get dates in my date column in 4 quarters Q1,Q1,Q3,Q4 using

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.