SyntaxFix
Write A Post
Hire A Developer
Questions
If dt is your datetime column, then
For 1:
SUBSTRING(CONVERT(varchar, dt, 13), 1, 2) + UPPER(SUBSTRING(CONVERT(varchar, dt, 13), 4, 3))
For 2:
SUBSTRING(CONVERT(varchar, dt, 100), 13, 2) + SUBSTRING(CONVERT(varchar, dt, 100), 16, 3)