Link to home
Start Free TrialLog in
Avatar of bogdem
bogdem

asked on

Time validation (IsTime)

Hi, All!
The problem is I'm trying to move my data from Excel spreadsheet to  MS SQL DB.
It's very important to keep data clean, so I need validate some columns, one of them time
Let say time is 10:59a
IsDate("10:59a") = true
But it's wrong, SQL Server won't accept it.
Any ideas how to validate time like that.
ASKER CERTIFIED SOLUTION
Avatar of JR2003
JR2003

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 PePi
PePi

maybe because the native datatype for SQL is datetime or smalldatetime. which means that you need to pass the Date portion instead of just the time. so instead of placing "10:59a", it should be something like "05/04/2005 10:59am".