locked
IsDate Function versus IsSqlServerDate RRS feed

  • Question

  • User2023521679 posted

    I kept getting error messages on a user form when I was inserting dates into SQL-Server if the user typed a valid date that was out of the range of what SQL-Server considers a date. For instance, if the user typed 01/01/957 instead of 01/01/1957. I edited the date field that the user typed in with the IsDate function, but the IsDate function considers 01/01/957 a valid date. But if I try to insert this date into a SQL-Server DateTime field, it returns an error since the date is out of range.

    After realizing this, I added edits to check the date range too. I am curious though, is there any sort of build in function like IsSqlServerDate that checks if the date is a valid date in SQL-Server?

    Just curious.

    Thursday, May 2, 2013 10:17 AM

Answers

  • User-1716253493 posted
    you can use rangevalidator type ="date" from 1/1/1900 to 1/1/2050 or check if date greater than 1/1/1900 after checking isdate
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 2, 2013 10:30 AM

All replies