How to check that wheather field is date and also in dd/mm/yyyy format

  • Hi,

    I have one table with the field of "Date1" of varchar type.

    I want to get all the records those are date and also in dd/mm/yyyy format.

    I am trying with following query.

    select ISDATE(Date1) from Table_1

    but it gives only the record which is in the formate of mm/dd/yyyy.but I want to check

    the field with dd/mm/yyyy.

  • Please Try this....

    Declare @STR varchar(10)

    Set @STR = '22/12/2010'

    Select IsDate(substring(@str,4,2) + '/' + substring(@str,1,2) + '/' + substring(@str,7,10) )

  • I am facing same problem in SSRS. Date is coming in dd/mm/yyyy string format from database and when i convert it to date is says "string is not date type" kind of error.

    NOTE: If date is coming in MM/dd/yyyy then it is only convertable into date format.

  • Thank you very much.It's working fine.

Viewing 4 posts - 1 through 3 (of 3 total)

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