Logo 
Search:

SQL Server Articles

Submit Article
Home » Articles » SQL Server » System FunctionsRSS Feeds

ISDATE Function

Posted By: Sarita Patel     Category: SQL Server     Views: 4860

This article explains about ISDATE function in sql server with examples.

ISDATE function is used to check that the specified expression is a valid date or not.

ISDATE returns 1 if the input expression is a valid date otherwise it returns 0.


Syntax of ISDATE Function :

ISDATE (expression)

expression is any valid sql server expression. It is of type varchar. 

Return type of ISDATE function is an integer.




Examples of ISDATE Function :

Example 1 : Use of ISDATE function in select clause 

SELECT ISDATE('10/13/1998')

Output
1

Above example returns 1 means specified string is a valid date.


Example 2 : Use of ISDATE function to check column value of table in select clause 

SELECT ISDATE(OrderDate)
FROM    Invoices 
WHERE  OrderID = 10888

Output
1

Above example returns 1 for OrderDate column value in invoices table.


  
Share: 

 
 

Didn't find what you were looking for? Find more on ISDATE Function Or get search suggestion and latest updates.

Sarita Patel
Sarita Patel author of ISDATE Function is from United States.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!