Question: I currently have a situation where I have to find the next value after my current move. 

Currently I have below:

```
 SELECT CONVERT(CHAR(17), PlannedStartDateUTC,13) 
 FROM   VisitMovement VM 
 WHERE  vm.VisitMovement_GUID = (SELECT VM2.VisitMovement_GUID 
                                 FROM VisitMovement VM2 
                                 WHERE vm2.OrderIndex = (VisitMovement.OrderIndex +10) 
                                   AND VM2.Visit_GUID = VisitMovement.Visit_GUID )) AS [Estimated Move],

```

Which works by using `VisitMovement.OrderIndex` to find the next move. However, in some situations the `OrderIndex` might not be +10 but +20. 

I can't understand how I would logically write this to find the next move.

Any more information please get in touch.

Answer: 
I met the save question and solved it.

make sure the myid is the save with your configuration in the zoo.cfg.

please check your zoo.cfg file in your `conf` directory, which contains such content.

```
server.1=zookeeper1:2888:3888  
server.2=zookeeper2:2888:3888  
server.3=zookeeper3:2888:3888  

```

and check the myid in your server dataDir directory. For example:

let's say the `dataDir` defined on the `zoo.cfg` is `'/home/admin/data'` 

then on zookeeper1, you must have a file named **myid** and have value 1 on this file ;on zookeeper2, you must have a file named **myid** and have value 2 on this file; on zookeeper3, you must have a file named **myid** and have value 3 on this file.

if not configured like this, the server will listen on a wrong ip:port.
In mycase, the issue was, I had to start all the three zookeeper servers, Only then I was able to connect to zookeeper server using `./zkCli.sh`