How to compare date,month,year

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deepikashalini
    New Member
    • Mar 2008
    • 18

    How to compare date,month,year

    hi,

    Im storing Issue date in database.
    Issuedate stored as varchar.
    and then compare to Passing string date('03/06/2008')

    what is query to compare storing varchar date to passing string date.
    its only compare date only. not compare month,year.
    i want to compare date,month,year all things.

    My query is
    SELECT * from Tbl_Downloadaud it
    WHERE UserID =36 and ProductID=190
    and issuedate < '03/07/2008' and issuedate !='03/07/2008'



    what is the query.Pls reply soon ....
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    since date is stored as varchar not DATE ,you can't compare the way you are trying to do using <.

    Comment

    • ck9663
      Recognized Expert Specialist
      • Jun 2007
      • 2878

      #3
      Convert everything to datetime data type.

      -- CK

      Comment

      Working...