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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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)
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)
ASKER
Thanks a lot, it works!
Ion
Ion
ASKER
Can the CONVERT function be used to do this? How?
Ion