473,324 Members | 2,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

How to assign a range of numbers for a specific data

Hi there!
I am trying to create a database for calculating costs of shipping an item depending on the postcode. Here is a picture that explains what I am trying to create: http://i.imgur.com/VrnBkTE.png

So as you can see, in region N1, the cost is $9.90 and covers the postcodes between 1000-2000, 2030, 2050-2070. I want to assign these values to the region N1 with the cost $9.90 so that when I look it up on the query, it shows the correct price. For example, if I were to enter 3502, I would expect it to show that it is in region N2 with a cost of $15.30.

I cannot figure out how to enter a data range to make this easy. Any help would be greatly appreciated!
Nov 2 '14 #1
1 1112
twinnyfo
3,653 Expert Mod 2GB
splashy,

What you are asking is somewhat simple, but will require you to build a table to hold all your regions.

Your Table should have three fields:

tblShippingZones

PostCodeStart The lowest value of the post code in this particular list
PostCodeStop The highest value of the post code in this particular list
ShippingRegion Foreign key to tblShippingRegions

tblShippingRegions will have three fields: One for the RegionID, one for the Name of the Region ("N1", "N2", etc.) and one for the Shipping cost to that region.

So, for example you give above in your pic, you would have 7 records:

PostCodeStart PostCodeStop ShippingRegion
1000 2000 N1
2030 2030 N1
2050 2070 N1
3000 3450 N2
3456 3456 N2
3487 3487 N2
3500 3600 N2

Then, when you want to find shipping rates, just compare the post code to the values in the table and when the post code is between the start and stop codes, then use the Shipping region.

Hope this makes sense.
Nov 3 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: amywolfie | last post by:
Hi All: I know this is simple, but I just can't seem to get there: I need to sort a table by a text field (txtDescription), then assign sequential numbers to the field SEQUENCE in table. ...
3
by: etam | last post by:
Hi, I need a very specific data control. It has to show multiple rows. It has to show data from database, such as id, name, etc. It has to allow user to update few of them. And the most...
3
by: printline | last post by:
Hello All I need a little help with a phph script to display some specific data from a mysql table. I have a mysql table with 4 columns and 10 rows. I want to display fx. data from row 4, 6, 8...
3
by: Serenityquinn15 | last post by:
Hi! I was wondering if it is possible to get the specific data coming from SQL Server 2000 and append it to my MS Access Table through VB Code???? If it so, please advise me on how i can do this...
1
by: Question123 | last post by:
Hi friends I am trying to develop windows application with C#.Net. With using Bloomberg API. But i am unable to get Industry specific data from bloomberg. such as (Top Performing...
2
by: cheweedog | last post by:
Can't set the open form by specific data. The form fields don't appear to choose. Trying to link number to number. One form contains a field called number, but does not appear as a choice to <> to...
21
Mas Juliza Alias
by: Mas Juliza Alias | last post by:
Hi, I am building a program on Information System for Reservoir Operation for my Masters research. Now I have a text file which is an output file from a processing software (Terramodel) that lists...
2
by: JonHuff | last post by:
looking for MS Access VBA code to do the following: I am trying to assign incrementing numbers ( ie - 1-10) to records in an existing table by date and pull a 10% random sample from that table based...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.