<p>I am trying to insert a time only value, but get the following error</p>

<blockquote>
  <ul>
  <li>ex  {"SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."}  System.Exception</li>
  </ul>
</blockquote>

<p>From the front end, the time is selected using the "TimeEdit" control, with the up and down arrows. The table in SQL Server has the fields set as smalldatetime. I only need to store the time. I use the following to return data to the app</p>

<p>select id,CONVERT(CHAR(5),timeFrom,8)as timeFrom,CONVERT(CHAR(5),timeTo,8)as timeTo
FROM dbo.Availability
where id = @id
and dayName = @weekday</p>

<p>How do I pass time only to the table?</p>

<p>Edit ~ Solution
As per Euardo and Chris, my solution was to pass a datetime string instead of a time only string. I formatted my result as per <a href="http://msdn.microsoft.com/en-us/library/az4se3k1(VS.71).aspx" rel="nofollow noreferrer">Time Format</a> using "g".</p>

<p>Thanks</p>

there is no such thing as Time in SQL, there is only DateTime.
For your purpose, I would use something like this to only return the time portion.
```
```
SELECT (GETDATE() - (CAST(FLOOR(CAST(GETDATE() as FLOAT)) AS DateTime)))
```
```
where GETDATE() is the datetime you want to filter.
When setting the time in the database, you will have to add '01/01/1901' or '01/01/1753' to the time.
Dont use CAST and Convert to varchar when working with datetime, its slow. Stick to floating numerical operations.