• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

T-SQL IsDate Function and Locale

Gumbo Robot

Fingers like lightning
Joined
Mar 12, 2015
Messages
977
Likes received
193
Thanks received
37
I'm trying to determine if a string represents a valid date.

So, IsDate('01/01/15') returns 1 as expected. IsDate('30/01/15') returns 0 even though it's a valid date.

I'm guessing the locale of the server is US & that's why IsDate is returning 0.

Is there a simple fix to this? I can't change locale or anything like that though.....
 
SET DATEFORMAT = 'dmy' seems to have fixed it.

Thanks.
 

Advertisers

Back
Top