I need to select a shortened version of a field from a SQL Server table to use in a drop down list.
This field has to be limited to twenty characters. If the field has more than twenty characters, it should display the first twenty; if it has less than twenty characters, it should display the whole string.
How do I do this?
You can use the LEFT command.
Try left(sting_field,20)
or right(sting_field,20)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With