Hi,
insert part 1
-----------------------------------------------------------
Hi, I've a table with a field datetime.
I'd like to write into only the time.
insert into CO_Period_Type (DE_Description, TS_Start_Time, TS_End_Time) values ('7777', ????,????)
gana78 (Programmer) Feb 7, 2002
-- code starts here
use pubs
go
create table tablename (dt1 datetime, dt2 varchar(8))
go
declare @abc varchar(8)
set @abc = convert(varchar(8), getdate(), 108)
insert into tablename values (@abc, @abc)
select *
from tablename
--code ends here
Since you have defined the column as "DATETIME" the sql server will add the default date of 1900-01-01.
If you want to avoid it, define the column as VARCHAR(8)
Hope this helps
-----------------------------------------------------------
my field must be a datetime, not a varchar.
With the microsoft console i can store only the time 1:00:00 PM f.e.
what's the query
insert part 1
-----------------------------------------------------------
Hi, I've a table with a field datetime.
I'd like to write into only the time.
insert into CO_Period_Type (DE_Description, TS_Start_Time, TS_End_Time) values ('7777', ????,????)
gana78 (Programmer) Feb 7, 2002
-- code starts here
use pubs
go
create table tablename (dt1 datetime, dt2 varchar(8))
go
declare @abc varchar(8)
set @abc = convert(varchar(8), getdate(), 108)
insert into tablename values (@abc, @abc)
select *
from tablename
--code ends here
Since you have defined the column as "DATETIME" the sql server will add the default date of 1900-01-01.
If you want to avoid it, define the column as VARCHAR(8)
Hope this helps
-----------------------------------------------------------
my field must be a datetime, not a varchar.
With the microsoft console i can store only the time 1:00:00 PM f.e.
what's the query