This blog is mostly a blog for me with hints to remember those little bits of code etc where ever I am. Please be aware of this when reading any of the posts as they are mainly reminders for me. When I get time I will try to flesh out those sections that are a little ambiguous.
Pages
▼
Friday, 31 October 2014
Pad leading Zero's in SQL
This example would pad a 3 character string with a leading zero:
SELECTRIGHT('000'+ISNULL(field,''),3)
NULL values will show as 000
If you have an Integar Value that you want to add leading zero's then:
No comments:
Post a Comment
Note: only a member of this blog may post a comment.