This question already has an answer here:
I'm trying to count points within a polygon but it's not working.
I think it has something to do with the co-ordinate system.
The points are from a text file and the line are from a dxf file. I had to set the co-ordinates for both as one was lat long and the other was an old Irish grid co-ordinate system.
When I buffered and dissolve the lines the resulting layer defaulted to the original co-ordinates.
I reset the line file to the correct co-ordinates and ran the query to count points within a polygon. The resulting layer defaulted to its original co-ordinates and all the values were null.