Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    119

    Unanswered: SELECT DISTINCT DATE with different time

    Hi! Good Day!

    What is the correct SELECT query if i want to count the distinct date from my table.

    Example:
    Table1
    DateField
    10/11/2005 5:14:48 PM
    10/11/2005 5:24:48 PM
    10/10/2005 5:14:30 PM
    10/13/2005 5:15:02 PM

    My query is something like this.
    SELECT COUNT(DISTINCT DateField) FROM Table1

    The result should be 3 and not 4
    because there are 2 records with the same date, only different time.

    Thanks

  2. #2
    Join Date
    Feb 2004
    Location
    Bangalore, India
    Posts
    250
    hi

    try this

    select distinct convert(varchar,datetimefield,110) from table
    Cheers....

    baburajv

  3. #3
    Join Date
    Oct 2005
    Posts
    119
    Thanks for taking the time to answer my question.
    My SELECT query is ok now.
    God Bless

Posting Permissions

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