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
 Transact-SQL (2000)
 change current date time to format 070102

Author  Topic 

ans_anish
Starting Member

1 Post

Posted - 2007-01-01 : 22:45:02
how can get the current date in the format to 070201(YYMMDD) and store in the variable @_CurTime nvarchar(6)

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-01-01 : 22:47:40
[code]declare @_CurTime nvarchar(6)
select @_CurTime = convert(nvarchar(6), getdate(), 12)
select @_CurTime [/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-01-02 : 06:24:34
1 Why dont you just use the value from the column which has datetime datatype?
2 Why do you need nvarchar(6) to store numbers?
3 Explain what you are trying to do. There may be better approach than what you are trying to do

Madhivanan

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

- Advertisement -