# Select Specific StarData

The help menu for StarData has many examples such as

StarData[EntityClass[
"Star", {EntityProperty["Star", "DistanceFromEarth"] ->
TakeSmallest[10]}]]


which are great. However, I'd like to select not the smallest, but stars that fall in a specific distance range, i.e., 100 - 200 ly from Earth (or range of any other property). I tried various options, but could not get it to work with a range.

You can use:

StarData[
EntityClass[
"Star",
"DistanceFromEarth" -> Between[{Quantity[100,"ly"],Quantity[200,"ly"]}]
]
]


or:

EntityList @ EntityClass[
"Star",
"DistanceFromEarth" -> Between[{Quantity[100,"ly"],Quantity[200,"ly"]}]
]

• Great – works. I tried Between, but forgot I need the Quantity. Thanks for this heads up. – Mockup Dungeon Mar 8 at 19:54