Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Symbol for Milliseconds in Datapart function
235383
HI All,
Good day....
Please let me know the symbol that we use for milliseconds in timestamp value.
Year = yyyy
Month = m
Date = d
Hours= h
Minutes= n
Seconds = s
Milliseconds=?
Thanks
prasad.B
Find more posts tagged with
Comments
mwilliams
capital S
235383
Hi Williams,
Thanks for your reply.
I used Capital S.It shows me like "the datepart 'S' was not recognized"
Attached the image of the error.
I am using datepart function for timestamp and casting it into varchar.
Below is the logic.
Cast(Datepart('yyyy',Column name) as varchar(4))
||
Cast(Datepart('m',Column name) as varchar(4))
||
Cast(Datepart('d',Column name) as varchar(2))
||
Cast(Datepart('h',Column name) as varchar(2))
||
Cast(Datepart('n',Column name) as varchar(4))
||
Cast(Datepart('s',Column name) as varchar(4))
so far i have not included milliseconds in the above logic.
But as per ur advice i included 'S' for miiliseconds in the logic as below.
Cast(Datepart('yyyy',Column name) as varchar(4))
||
Cast(Datepart('m',Column name) as varchar(4))
||
Cast(Datepart('d',Column name) as varchar(2))
||
Cast(Datepart('h',Column name) as varchar(2))
||
Cast(Datepart('n',Column name) as varchar(4))
||
Cast(Datepart('s',Column name) as varchar(4))
||
Cast(Datepart('S',Column name) as varchar(4))
when i execute the report , i get the error as attached.
Please help me on this.
Thanks
Prasad.B
mwilliams
I'm sorry. I missed the datepart portion of the title. Try 'ms'.