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.
| Author |
Topic |
|
nemohm
Yak Posting Veteran
69 Posts |
Posted - 2003-06-23 : 12:53:28
|
| Hello,There is a column that returns different data, depending on the place of query.1.When I open the table in EM data looks like:6/18/2003 5:22:15 PM2.In Query Analyzer:Select (utc) from events2003-06-19 23:26:35.700select max(time1) as time, max(utc) as utc from EventsAPCPSAtime utc127005387957018750 2003-06-19 23:26:35.7003.When I attempt to get only milliseconds:select substring(cast(utc as char(30)), 20, 3)from EventsAPCPSA---no return---select substring(cast(utc as char(30)), 18, 3)from EventsAPCPSAPMAre there any milliseconds, and is there a way to get only the millisecons ?Thx,Dobby |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-06-23 : 13:35:35
|
How does:SELECT RIGHT(Convert(varchar(26),GetDate(),121),3) Float your boat?Brett8-) |
 |
|
|
Arnold Fribble
Yak-finder General
1961 Posts |
Posted - 2003-06-23 : 14:47:26
|
Dates aren't floats SELECT DATEPART(ms, GETDATE()) |
 |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2003-06-23 : 15:04:03
|
Well, they're DWORDS, so close enough Edited by - setbasedisthetruepath on 06/23/2003 15:04:30 |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-06-23 : 16:44:44
|
quote: Dates aren't floats SELECT DATEPART(ms, GETDATE())
[homer]Dooooohh[/homer]Datepart, but of course...Brett8-) |
 |
|
|
|
|
|
|
|