1

Sybase docs show how to convert to several date/time formats, but none show the microseconds that bigdatetime support. What CONVERT style can I use?

For instance:

SELECT CURRENT_BIGDATETIME() 
-------------------
May  8 2019  4:30PM
                 ^^^ I want microseconds here
eric
  • 755
  • 6
  • 11

1 Answers1

1

I found several styles for which I could not find documentation, but they work for me, for instance,

SELECT CONVERT(CHAR(50),CURRENT_BIGDATETIME(),138)
May  8 2019  4:47:55.706489PM

Here are the styles I found and what their output looks like:

Style   Output
36      4:34:28.070375PM
37      16:34:28.073989
38      May  8 19  4:34:28.077720PM
39      May  8 19 16:34:28.081418
40      19-05-08 16:35:41.892544
136     4:37:10.291454PM
137     16:37:10.295289
138     May  8 2019  4:37:10.299460PM
139     May  8 2019 16:37:10.304023
140     2019-05-08 16:37:10.308430
141     May  8 2019  4:37:10.312575PM

(this is on Adaptive Server Enterprise/15.7...)

eric
  • 755
  • 6
  • 11