Datatype Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kiss07
    Banned
    New Member
    • Jan 2007
    • 99

    Datatype Problem

    Dear friends,

    i want to retrieve all the records in date_of_call is 11/18/2006.


    date_of_call call_id dept_id
    --------------- ----------- ----------
    11/18/2006. 4508 cs22
    1/7/1970 3434 DE2

    date_of_call is date datatype.



    Arun....
  • frozenmist
    Recognized Expert New Member
    • May 2007
    • 179

    #2
    Arun,
    Please be specific about your problem. Where is the datatype problem. A simple select query would be fine right.
    with where caluse as
    where date='11/18/2006'
    .
    If this is not the problem. Please do explain it more clearly.

    Comment

    • pradeep kaltari
      Recognized Expert New Member
      • May 2007
      • 102

      #3
      Please be more clear in your question.

      As far as I could understand from that, the following query should do:

      Code:
      SELECT *
      FROM TABLE_NAME
      WHERE DATE_OF_CALL='11/18/2006'

      Comment

      • chandu031
        Recognized Expert New Member
        • Mar 2007
        • 77

        #4
        Originally posted by kiss07
        Dear friends,

        i want to retrieve all the records in date_of_call is 11/18/2006.


        date_of_call call_id dept_id
        --------------- ----------- ----------
        11/18/2006. 4508 cs22
        1/7/1970 3434 DE2

        date_of_call is date datatype.



        Arun....
        Hi Arun,

        Plz be more clear as to what is it that you want.
        As far I can understand, you want all those records where the date is 11/18/2006.

        Code:
        SELECT * FROM TABLE WHERE TO_CHAR(DATE_OF_CALL ,'MM/DD/YYYY') = '11/18/2007';
        It's a fairly simple query , which you should be able to get if you have basic SQL knowledge.
        Last edited by chandu031; May 7 '07, 10:23 AM. Reason: Syntax error

        Comment

        • kiss07
          Banned
          New Member
          • Jan 2007
          • 99

          #5
          hi,

          ORA-01843: not a valid month

          this is my error.

          my sql:

          select * from dsa_conv_opps_r eporting_load where date_of_call='1 1/18/2006'

          ORA-01843: not a valid month

          pls reply..

          Arun

          Comment

          • chandu031
            Recognized Expert New Member
            • Mar 2007
            • 77

            #6
            Originally posted by kiss07
            hi,

            ORA-01843: not a valid month

            this is my error.

            my sql:

            select * from dsa_conv_opps_r eporting_load where date_of_call='1 1/18/2006'

            ORA-01843: not a valid month

            pls reply..

            Arun
            Hi Arun,

            The above error occurs because your date value is not in the default format. So you will have to cast the field to whatever format is used in the literal, and then compare it with the literal. I have already posted the query for doing this.

            Comment

            • pradeep kaltari
              Recognized Expert New Member
              • May 2007
              • 102

              #7
              Originally posted by kiss07
              hi,

              ORA-01843: not a valid month

              this is my error.

              my sql:

              select * from dsa_conv_opps_r eporting_load where date_of_call='1 1/18/2006'

              ORA-01843: not a valid month

              pls reply..

              Arun
              Hi Arun,

              Code:
              SELECT * FROM TABLE WHERE TO_CHAR(DATE_OF_CALL ,'MM/DD/YYYY') = '11/18/2007';
              This should work.

              Comment

              • debasisdas
                Recognized Expert Expert
                • Dec 2006
                • 8119

                #8
                Please try this
                Code:
                select * from dsa_conv_opps_reporting_load where date_of_call='18-nov-06'
                Hope it will solve your problem.

                Comment

                Working...