What I'm trying to do is trim an FQDN down to just the name of the asset.
For example, let's say I have a machine called "Desktop1.mycompany.com"
and I just want to have the value "Desktop1"
in another field.
I've done a trim command Trim(Left([ColumnwithFQDN],(InsStr(1,[ColumnwithFQDN],".")-1)))
and it works. It removes everything but the machine name.
However, I notice this list has some computer names without the FQDN and they're just showing up as "Desktop2"
. Obviously, this causes a #Func! error
.
My question is: is there any way to either skip anything that's not in the FQDN or have it just return the original value if the function fails?
I think I could do an IIf(IsNull)
command, but I'm not sure what I would be setting as the value to return.