Link to home
Start Free TrialLog in
Avatar of Aleks
AleksFlag for United States of America

asked on

Problem running sql query on sql express

I am running a query on a few servers, it works fine on all SQL 2008 R2 and up. But when I ran it on an SQL Express 2005 I got an error.

This is the query:

SELECT ExpiresOn as originalValue,
    CONVERT(VARCHAR(25), CONVERT(DATE, ExpiresOn), 101) as newValue
    FROM Users
    WHERE ISDATE(ExpiresOn) = 1

This is the error:

Type DATE is not a defined system type

Is there a way to tweak the sql above so it works on 2005 ?   Meantime Ill advice my client to update their SQL.
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Aleks

ASKER

I agree. I already asked the client to upgrade to 2008R2

I heard it also doesn't work on 2012  ?  Is this true ?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Aleks

ASKER

Thanks everyone !