Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Inserting just the time into a DateTime field

Author  Topic 

matt_calhoon
Posting Yak Master

235 Posts

Posted - 2002-08-09 : 01:36:06
Hi there,

Ive a stored proc that inserts the a time value into a datetime field - but sql converts the time to a full dateTime value. Eg if I insert #06:00 PM# it will insert the following:
8/9/2002 6:00:00 PM

Is there any way to just insert the Time without Sql adding todays date?

CREATE PROCEDURE p_INSERT_CLUBS
@TEE_SHEET_START_TIME datetime
AS
INSERT INTO tblCourse
(TEE_SHEET_START_TIME)
VALUES
(@TEE_SHEET_START_TIME)

thanks - matt

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-08-09 : 02:30:35
Hi Matt

No, it is a datetime field after all . Let SQL Server store how it wants, then just display the time when you pull the data out.

Damian
Go to Top of Page

matt_calhoon
Posting Yak Master

235 Posts

Posted - 2002-08-09 : 03:12:58
thought so!

thanks anyhow.

Go to Top of Page
   

- Advertisement -