Link to home
Start Free TrialLog in
Avatar of iamari
iamari

asked on

Time field in SQL Server 6.5

I'm trying to migrate a MSAccess database to SQL Server 6.5 In MsAccess I have 2 time fields defined as "short time".
I just realized there is no such datatype in SQL Server. Is there a way to handle this using the "small datetime" type?

If you know the answer, please post an example, as I'm not very familiar with SQL Server

Help appreciated,

Ion
ASKER CERTIFIED SOLUTION
Avatar of Victor Spiridonov
Victor Spiridonov
Flag of Russian Federation image

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

ASKER

The problem is not so much how to display only the time, but how to insert only time from a web form? The user will just type something like 23:15

Can the CONVERT function be used to do this? How?

Ion
You can insert just '23:15', it will default to 1/1/1900 23:15 there is no way to have only time.
Example:
create table test (tt datetime )
go
insert into test values ('23:15')
select * from test
Result:
(1 row(s) affected)

tt                          
---------------------------
1 Jan 1900 23:15            

(1 row(s) affected)
Avatar of iamari

ASKER

Thanks a lot, it works!

Ion