Link to home
Start Free TrialLog in
Avatar of dalebrumbaugh
dalebrumbaugh

asked on

timestamp

I want to preserve the seconds and milliseconds in the timestamp when I assign it to a variable:

select current_timestamp

returns:
2006-06-19 12:00:34.770


Declare @TimeString nvarchar(50)
set @TimeString = (select current_timestamp)

returns:
Jun 19 2006 11:58AM
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Declare @TimeString nvarchar(50)
select @TimeString = convert(varchar(30),current_timestamp,120)
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial