# system.kanoa.event.getAdjacentStateEvent(assetId, tStamp, ascending)

Gets the previous or next stateEvent entry for the assetId based on the tStamp passed and the direction to look i.e. ascending or 'descending

---
### Parameters
**assetId** `Integer`: Id of asset<br />
**tStamp** `DateTime`: Time stamp to search from<br />
**ascending** `Boolean`: True for ascending, false for descending<br />

---
### Returns
**stateEventData** `pyDataset`<br />

---
### Example
```python
assetId = 123
tStamp = system.date.now()
modeEventId, msg = system.kanoa.event.getAdjacentStateEvent(assetId, tStamp, True)
```
