The select I made from yours looks like this
SELECT Left([WM_MultiCenterIntegration.MC_Nodename],IIF(Instr(1,".",[WM_MultiCenterIntegration.MC_Nodename])=0,Len([WM_MultiCenterIntegration.MC_Nodename]),Instr(1,".",[WM_MultiCenterIntegration.MC_Nodename]))) As A FROM WM_MultiCenterIntegration;
the result is
NEWDELHI.DMT.DK
ODIN
And the result I'm looking for is
NEWDELHI
ODIN
If I replace substr with mid in Lespaul's select it complains about funktion 'length'
Have you tried this ?
SELECT IIf(InStr(MC_Nodename,".")=0,MC_Nodename,Left(MC_Nodename,InStr(MC_Nodename,".")-1)) As Nodename
FROM WM_MultiCenterIntegration;
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.