I'm using this query in CartoDB to find the number of locations within a certain range of a set point:
SELECT COUNT(*) FROM location_fusion_table where ST_DWithin(location_fusion_table.the_geom, ST_GeomFromText('POINT(39.704017 -104.959488)', 4326), 500)
If I use the number 500 or higher, this returns a count that equals every location in my table (i.e., it counts every row). 200 returns about 2/3 of all of my locations in the table (it should be about 100 returned instead of 20,000).
Clearly, these numbers are wrong, but I'm not sure what the issue is.