CaptNemo Posted November 5 Report Share Posted November 5 How do I add a leading zero in my date field if the hour is less than 10? Quote Link to comment Share on other sites More sharing options...
0 Winskey Posted November 5 Report Share Posted November 5 You may use this formula. CASE WHEN DATEPART(hh, [@field:Date_Field]) < 10 THEN '0' + CAST(DATEPART(hh, [@field:Date_Field]) AS VARCHAR) ELSE CAST(DATEPART(hh, [@field:Date_Field]) AS VARCHAR) END Quote Link to comment Share on other sites More sharing options...
Question
CaptNemo
How do I add a leading zero in my date field if the hour is less than 10?
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.