column length select query
-
Hi, I would like to retrieve specific region names, where a region code is less then 3 characters. I cant just do a normal select query, as some of the codes are more then 3 characters. Here is my sql query, but its not returning anything. SELECT RegionName, RegionCode FROM Region WHERE DATALENGTH(RegionCode) < 3 ORDER BY RegionName
-
Hi, I would like to retrieve specific region names, where a region code is less then 3 characters. I cant just do a normal select query, as some of the codes are more then 3 characters. Here is my sql query, but its not returning anything. SELECT RegionName, RegionCode FROM Region WHERE DATALENGTH(RegionCode) < 3 ORDER BY RegionName
Change query as below and try SELECT RegionName, RegionCode FROM Region WHERE len(RegionCode) < 3 ORDER BY RegionName
Thanks, Ziyad Mohammad [http://www.dotnetsoldier.blogspot.com/]
-
Change query as below and try SELECT RegionName, RegionCode FROM Region WHERE len(RegionCode) < 3 ORDER BY RegionName
Thanks, Ziyad Mohammad [http://www.dotnetsoldier.blogspot.com/]