Results 1 to 2 of 2

Thread: how to compare dates

  1. #1
    Harish Guest

    how to compare dates

    how to compare the dtaes for the follwing

    SELECT COL1,COL2 FROM TABLE1
    WHERE WORKDATE >01/01/2002

    THE WORKDATE IN THE TABLE IS HAVING DATETIME DATATYPE.
    I DONT WANT CONSIDER THE TIME OF THE DATEPART.
    I JUST WANT TO COMPARE THE DD-MM-YYYY.

    PLEASE HELP ME IN THAT.
    THANKS IN ADVANCE

  2. #2
    sekhar Guest

    how to compare dates (reply)

    you can give simply date part without time in where clause.
    When given this way sql defaults to mid night of that date.
    You can use convert function to represent date as you need.
    Look in BOL for details on CONVERT

    Hope this is clear


    ------------
    Harish at 2/4/2002 2:01:16 PM

    how to compare the dtaes for the follwing

    SELECT COL1,COL2 FROM TABLE1
    WHERE WORKDATE >01/01/2002

    THE WORKDATE IN THE TABLE IS HAVING DATETIME DATATYPE.
    I DONT WANT CONSIDER THE TIME OF THE DATEPART.
    I JUST WANT TO COMPARE THE DD-MM-YYYY.

    PLEASE HELP ME IN THAT.
    THANKS IN ADVANCE

Posting Permissions

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