Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Issues with IsDate() Expand / Collapse
Author
Message
Posted Thursday, January 27, 2011 8:22 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, May 9, 2012 3:46 AM
Points: 2,223, Visits: 177
Comments posted to this topic are about the item Issues with IsDate()
Post #1055059
Posted Friday, January 28, 2011 2:15 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Saturday, March 5, 2016 7:55 PM
Points: 1,354, Visits: 1,300
Using that Stuff example, wouldn't that be the same things as:
select isdate('1753'+ ' ')

Post #1055160
Posted Friday, January 28, 2011 2:57 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 3:30 AM
Points: 1,559, Visits: 2,561
I'm confused as to why you would consider '1753' to be an invalid date (assuming we're using the Julian calendar).

Datetime datatype runs from 1st January 1753, and the implicit and explicit conversions of '1753' are 1753-01-01.

Also if it's just 1753 you have a problem with, then your method doesn't work anyway; try

select isdate(Stuff('2011', 4, 0, ' '))

Post #1055179
Posted Friday, January 28, 2011 3:13 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, November 30, 2015 9:53 AM
Points: 15, Visits: 107
And what happens if you actually send a real date to isdate using this so-called 'workaround'? It fails, of course, so what possible use is it? Surely you would check to see if the input to the function even resembled a date, rather than attempting to handle integers in this way. Non-problem which has produced a non-solution, sorry.
Post #1055184
Posted Friday, January 28, 2011 7:12 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, November 29, 2012 8:03 AM
Points: 1, Visits: 11
i dont understand the usage of any such formula ?
can anyone explain the real scenario where this is useful.

for any input in select isdate(Stuff('input', 4, 0, ' '))

it gives me '0' answer ,
Post #1055306
Posted Tuesday, May 17, 2016 7:04 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:30 AM
Points: 7,892, Visits: 765
Interesting comments about dates.
Post #1786859
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse