Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Checking the format of an IP Address

$
0
0

Hey All,

I tried looking for a response that would cover this, but everything I found was either not what I was looking for, or was in a different program topic.

I have a fairly straightforward 9-column table-based report that is basically printing out the source SQL table but in a nicer format. My problem is that one of the columns is classified as an "IP Address" but it currently has no constraints in the DB beyond "varchar", which means that several rows are not actual IP addresses.

The client would like me to configure the report so that:

  • Any values that match the standard IP format (0-255.0-255.0-255.0-255) are displayed.
  • Any values that fall outside this format are replaced with the text "<Not Valid>".

I've got the replacement work down, the problem is I have no idea how to fully evaluate the string as an IP address. (The closest I got was saying "If the 4th character is not ".", replace."

Thanks,



Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>