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

  • SEARCH
  • Home
  • 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 8361055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:36:57+00:00 2026-06-09T11:36:57+00:00

I am trying to input a date value from the user and then using

  • 0

I am trying to input a date value from the user and then using that value in the query.

 select * from  TB_MNP_GTY_TRANS_STEPS where CREATE_DATETIME>=&startdate

Now when i run the sql statement in Toad and input 8/1/2012 as date data type i am getting

ORA-00932: inconsistent datatypes: expected DATE got NUMBER

Can someone suggest where i am wrong.Note that CREATE_DATETIME is of Date Type.

  • 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-09T11:36:58+00:00Added an answer on June 9, 2026 at 11:36 am

    You should really specify what date format you are using in your parameter:

    SELECT *
      FROM TB_MNP_GTY_TRANS_STEPS 
     where CREATE_DATETIME >= TO_DATE(&startdate, 'DD/MM/YYYY');
    

    Read about date formats here

    Currently your session is expecting the date to be in its default NLS_DATE default fomat and obviously the format of the date you’re entering is different.
    Explicitly specifying date formats prevents this issue from occurring.

    Hope it helps…

    EDIT:
    If you want to pass in the 8th January 2012 then you could specify your variable value as:

    08/01/2012
    

    And your select would be:

    SELECT *
      FROM TB_MNP_GTY_TRANS_STEPS 
     where CREATE_DATETIME >= TO_DATE(&startdate, 'DD/MM/YYYY');
    

    Depending upon your environment you might need to wrap the variable in single quotes (for TOAD you definiely will) i.e.

    SELECT *
      FROM TB_MNP_GTY_TRANS_STEPS 
     where CREATE_DATETIME >= TO_DATE('&startdate', 'DD/MM/YYYY');
    

    The error you are getting is caused by the format of the date string you are entering not matching EXACTLY the format you are specifying (see the leading “0” before the 8 and 1 in the day and month!)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create an HTML5 input date component so that I can
I'm trying to convert an input date string to a date format and then
I am trying to get a date object from a string from an input.
I am trying to create a Date object from an input String. The code
I'm trying to bind the selected value from the date picker to an asp
I'm trying to derive the users age from DOB using a script, then depending
I'm trying to let users type in date and time values into an input
I am trying to input data from a text file in C++. The text
Hi there I'm trying to input 3 integers from the keyboard and print rows
Using VB.NET with ASP.NET and and ms-access 2003 data, I'm trying to input data

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.