on 10-13-2008 10:01 AM
Hi
I have a table containing postcodes and their X and Y coordinate location. I am trying to run a query whereby I select one postcode which then selects all the postcodes that lie within a selected radius of this point. However anything I try seems to keep leading me up a blind alley. Does anyone know if this type of query is possible in Crystal Reports?
The theory:
to see whether a point lies within a circle, find its distance from the centre.......if its less than the radius...then it falls inside....
distance = sqrt((x2-x1)2 + (y2-y1)2)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The problem I have is using this equation as a selection formula. If I select a postcode I need to somehow use it's postcode X and Y coordinates in the query to select the relevant postcodes. I'm quite new to Crystal Reports and I keep getting stumped that when I do something that is evaluated in the second pass I can't use that in a selection formula which I think is calculated in the first pass. Is this right?
Yes, that's correct.
You're picking it up quickly.
I suggest you look at:
-adding sub sections to sections (Group Footer 1, Group Footer 1a, etc)
-shared variables
-WhilePrintingRecords
-BeforePringtingRecords
-EvaluateAfter
Place whatever formula you have in a section and actually see when it is evaluated.
This will tell you it's ok to place the next formula in the same section or one below it.
This is tricky, so it takes a little experimentation and patience.
Hope this helps,
The Panda
You need a GIS system!
What backend database are you using?
I'm aware some of them support spatial queries.
Regards,
Dom
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.