date time query

  • quoteI've 6 records with following date

    2003-11-03 00:00:00.000

    when i run ur second query it returns only 1 record!! i mean

    ISO date format is yyyymmdd so your query should have looked like this

    declare @x varchar(8)

    SET @x ='20031103'

    select taskid,taskname,entrydt from task

    where convert(varchar(8),task.entrydt,112) = @x

    Take note of Jorge's comments about indexes and performance as this type of query will do a table or index scan

     

    Far away is close at hand in the images of elsewhere.
    Anon.

  • i strongly advise you / everyone to read about datetime handling in books online.

    date and time handling is an extensive topic.

Viewing 2 posts - 16 through 16 (of 16 total)

You must be logged in to reply to this topic. Login to reply