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
 General SQL Server Forums
 New to SQL Server Programming
 Storing date

Author  Topic 

mageshks
Yak Posting Veteran

59 Posts

Posted - 2006-06-14 : 09:36:54
i need to store date alone in a new field from the existing field which is stored date along with time.

Eg:
old field: emplogintime (date and time)
new field: emploginday (date)

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-06-14 : 09:54:05
If your column is a datetime column, you can use the F_START_OF_DAY function on this link to convert it to a datetime value with the time part removed.

Start of Time Period Functions:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=64755


If you need to get the time part without the date, you can use the function on this link:
Time Only Function: F_TIME_FROM_DATETIME
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=65358



CODO ERGO SUM
Go to Top of Page

mageshks
Yak Posting Veteran

59 Posts

Posted - 2006-06-14 : 10:02:35
Thanks Jim - Magesh
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-14 : 10:07:14
You dont need to have other column that stores only date. Do the formation at Front end application. Otherwise look for convert function in sql server help file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-14 : 10:10:42
quote:
Originally posted by mageshks

Thanks Jim - Magesh


Who is Jim?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -