Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2011
    Posts
    4

    Post Unanswered: compare two dates in database ??

    Hello Friends,

    I have trouble in database date Comparison so I have not found sufficient answer in Google so please give some idea about date Comparison???

  2. #2
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    More information please.
    Ken

    Maverick Software Design

    (847) 864-3600 x2

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by amkeabhi123 View Post
    ...so please give some idea about date Comparison???
    here is an example ...

    Code:
    SELECT stuff
      FROM daTable
     WHERE datecolumn > '2012-09-10'
    seems legit

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Dec 2011
    Posts
    4
    i have one table two date column but compare date between two date likes as

    I have found the result between 02/02/2013 to 21/03/2013
    but i am comperision then found the less then date but not getting sufficient result, you can take flight search example so please help two column database comperision.

  5. #5
    Join Date
    Feb 2013
    Posts
    1
    compare both dates with sysdate individually & read value into a variable each****n a if stmt to check if both are same......guess this would help u.....take care...
    Last edited by aloka; 02-02-13 at 12:11. Reason: spelling mistake

  6. #6
    Join Date
    Jan 2013
    Posts
    354
    Provided Answers: 1
    Do you understand the difference between numbers and numerals? "XIX" and "19" are both numerals (Roman and Arabic) that represent the number nineteen.

    I have the horrible feeling that you are storing temporal data in strings. We have the DATE data type. The ANSI/ISO Standards allow one and only one display format, namely ISO-8601, "yyyy-mm-dd" and anything else is local dialect.

  7. #7
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    Quote Originally Posted by amkeabhi123 View Post
    i have one table two date column but compare date between two date likes as

    I have found the result between 02/02/2013 to 21/03/2013
    but i am comperision then found the less then date but not getting sufficient result, you can take flight search example so please help two column database comperision.
    The format of 02/02/2013 and 21/03/2013 looks 'dd/mm/yyyy'.
    But, could Microsoft SQL Server(or other DBMS) understood the format?

    As Celko stated
    The ANSI/ISO Standards allow one and only one display format, namely ISO-8601, "yyyy-mm-dd" and anything else is local dialect.
    ISO format 'yyyy-mm-dd' might be more widely understood.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •