Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Array
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Array

 Post Reply Post Reply Page  <123>
Author
Mattblack View Drop Down
Groupie
Groupie
Avatar

Joined: 21 January 2003
Location: United Kingdom
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mattblack Quote  Post ReplyReply Direct Link To This Post Posted: 07 November 2004 at 9:41am
and would the 2 tables have to be in the same database?
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 07 November 2004 at 10:25am
Yes they would have to be in the same DB
Back to Top
Mattblack View Drop Down
Groupie
Groupie
Avatar

Joined: 21 January 2003
Location: United Kingdom
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mattblack Quote  Post ReplyReply Direct Link To This Post Posted: 07 November 2004 at 11:21am
k, thats fine.  But how do i do it?
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 07 November 2004 at 1:08pm
Well the intial query to get the distance could be something like

Select SQR(
(
(69.1* (125.3 - 117.1)) * (69.1*(125.3 - 117.1))
)
+
(
(69.1 * (22.2 - 11.1)) * cos(117.1 / 57.3) * (69.1 * (22.2 - 11.1)) * cos(117.1 / 57.3))
)


(just used some values as example)

now I don't know how you want to proceed. You said you wanted to find every city (or zip) within x miles, that will get very complicated in access in one "swoosh" if not impossible. I am not that well versed in access but needless to say would be much simpler in sql server...
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 07 November 2004 at 1:18pm
Does Access allow user functions?
Or you could use ASP to figure out the value and then pass it to Access. I don't understand where the multiple callls to the database are for.
Back to Top
Mattblack View Drop Down
Groupie
Groupie
Avatar

Joined: 21 January 2003
Location: United Kingdom
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mattblack Quote  Post ReplyReply Direct Link To This Post Posted: 07 November 2004 at 2:19pm

im not very experienced with all this stuff, thats why i wrote it so that it runs through the whole table and calculates the distance to each postcode in the table.  If the value is less than the specified mileage then it keeps the postcode for later (To query on the next table - the adverts table if it was a sales/wanteds board for example).

Dont understand access well enough to do this.

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 07 November 2004 at 9:11pm
You can't do a UDF in access, you would have to write a module for that. The biggest problem you have is that loading all zip's into an array would slow the site down quite a bit.

I think what Mattblack is trying to do is let a user enter a postal code and return values of i.e. products that are within x miles of that postal code. That said I almost believe the best bet is to use what you have even though it's slow. For an application like that I really recommend a SQL Server Database or look for a wsdl webservice that you can query, that way you offload the work to the other server, thus it may cost a fee.
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 07 November 2004 at 10:53pm

Not sure what you're tyring to do here or how the postal codes are laid out in Britain, but you may want to think about prepopulating a table(s) that contain postal codes adjacent to a given postal code. That way, in real-time, you first calculate those postal codes, and then if no hit, you can calcucate all the rest. Sowls down some results, but speeds up the majority of them.

Other variations include all codes within 2 postal codes of a given code (geographically - not numerically). Or do the quick calcs on all codes within 10 numeric codes of your postal code. The object here is to do a smaller set of calcs that have a high chance of containing your results, and then do the entire set of calcs for the remainder.

Did something like this for a dispatch system once and one of the factors is the "average" distance between postal codes - in Western States, a code can cover 100's of square miles. In NYC, a couple of blocks.


Lead me not into temptation... I know the short cut, follow me.
Back to Top
 Post Reply Post Reply Page  <123>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.