Sql query date problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fcccc
    New Member
    • Jul 2008
    • 2

    Sql query date problem

    Hello guys, I need some help.
    I have a table with a date field and i have a problem when i want choose data between two dates, like for example: 15-05-08 and 01-07-08.
    When i choose this date it can't find the data, if I choose date between 15-05-08 and 16-07-08 the data is appear.
    My conclusion is that if I choose the first digit lower date (15-) is more less that upper date, then the result is ok.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Is the date stored as date or char ?

    Comment

    • fcccc
      New Member
      • Jul 2008
      • 2

      #3
      Originally posted by debasisdas
      Is the date stored as date or char ?
      The type of data is char(26).(dd-mm-yy hh:mm:ss)

      thank you for your answer

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        Convert both to the same data type. Preferrably datetime...


        -- CK

        Comment

        Working...