SQL Developer

  • ISDATE(OPS_PROJ_FMIS.STATE_OPTION_2) = True

    Trying evaluate if this OPS_PROJ_FMIS.STATE_OPTION_2 date and keep getting an error

    How Do I used IsDate Funtions in this?

     

  • 1=True, 0=False

    Try ... ISDATE(OPS_PROJ_FMIS.STATE_OPTION_2) = 1

  • Although this sounds like a strange question, why are you trying to check something to see if it's a date?  If you intend to CONVERT it without having a failure, use TRY_CONVERT() or TRY_CAST() instead.  If it's a valid DATE or DATETIME, it'll return it in the DATATYPE you specified.  If it's not valid, it'll return a null.

    Also, when you have a question on a function of this nature, it'll take you less time to look it up than to ask the question on a forum.  See the following and look for the RETURN TYPE (an INT, in this case) and a couple of the examples.

    https://learn.microsoft.com/en-us/sql/t-sql/functions/isdate-transact-sql

     

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • This was removed by the editor as SPAM

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

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