Starting on the round of use, Sandstorm will cause damage at the end of the round to both pokemon that are in play. The damage dealt is equivalent to 1/8th of a pokemon's maximum HP (by integer division). If either of the pokemon has Ground, Rock, or Steel as one or both of their types, that pokemon will not take damage from Sandstorm.
Nothing can stop damage from being dealt as long as a pokemon does not have one of the immune types as one of its types. This includes ignoring the effects of Protect/Detect, and bypassing a Substitute.
Sandstorm is a Weather Effect move. Weather Effect moves last for 5 round. Weather effect moves do not actually target either pokemon in play. As such, they are not subject to any form of Accuracy modification, including the Evade modifiers of either pokemon, Protect/Detect, or Brightpowder. They also do not directly figure into attacks which take damage dealt to a pokemon by a single attack into account, such as Bide, Counter, or Destiny Bond.
There may only be one Weather Effect move active at one time. If a Weather Effect move other than the one currently active is used, the current one stops and the new one will start its 5 rounds of effect.
Weather Effect moves include: Rain Dance, Sandstorm, and Sunny Day.