all groups > sql server mseq > december 2003 >
You're in the

sql server mseq

group:

=> Date Format


=> Date Format Rhonda Fischer
12/15/2003 10:49:28 AM
sql server mseq:
Hello,

I am having problems with the datatype date. I
sometimes want to refer only to the time part of
date to display in my Access Project form field.

In fact most of my current forms separate time
from date and deal with both separately, this is
possible in Access. Though cases a problem when I
save a time from and Access Form to a smalldatetime
SQL Server table column.

Is there a way to extract the time when displaying
to a form and save a time without specifying the date?

Any ideas would be much appreciated.

Kind regards
Re: => Date Format Vishal Parkar
12/16/2003 9:59:36 PM
Rhonda,

[quoted text, click to view]

if the datatype that you are using is datetime them you can use CONVERT function to
display only time part out of it.

Ex:

select convert(varchar(12),getdate(), 112) only_date,
convert(varchar(12),getdate(), 114) only_time

There are various formatting numbers that can be used in CONVERT function to retrieve the
format of datetime values. See more help on the topic "CAST and CONVERT" in books online.

[quoted text, click to view]

SQL Server does not have time data type. If you want to store only time part out of a
datetime then you can make use of VARCHAR datatype.


--
- Vishal

AddThis Social Bookmark Button