SQL Server Convert Datetime to String (CONVERT Style Codes, CAST, FORMAT)
Dates stored in SQL Server have no display format, so when a report wants 07/04/2026 you have to convert the datetime to a string yourself. The quickest way is CONVERT with a style code: That returns 07/04/2026. Swap 101 for 23 and you get 2026-07-04; swap it for 112 and you get 20260704. In this … Read more >>