Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to have a smalldatetime type hold just the time

Status
Not open for further replies.

hoggle

Programmer
Jul 13, 2001
124
US
We need to store time (as military time) is there anyway to do this without storing it in a varchar?
Using either a datetime or smalldatetime type (but we don't want to store the date with it)

thanks!
 
No. DATETIME and SMALLDATETIME store both date and time. You can use the 'front-end' (asp, vb, crystal reports, etc) to retrieve only the time.

Insert only the time and SQL will add the default date, then do your query dropping/truncating the date off.

-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top