bustersports
Programmer
Hi,
I have a database that is used to determine shipping rates based on multiple factors. I am trying to determine what the weight break would be when given a shipment weight. Below is the table layout and an example of what I am looking to get.
Table
MinWgt MaxWgt Zone Rate Minimum ServiceLevel
151 299.99 2 $0.18 $72.00 NH
300 499.99 2 $0.16 $72.00 NH
500 999.99 2 $0.15 $72.00 NH
1000 1999.99 2 $0.14 $72.00 NH
2000 4999.99 2 $0.12 $72.00 NH
5000 9999.99 2 $0.10 $72.00 NH
There are multiple zones and service levels, such as Zones 1-10 with up to 6 different service levels for each.
Examples
Weight - 464.0731 Zone 2 ServiceLevel NH - rate found should be $.16 from weight 300 - 499.99
Weight - 151.0966 Zone 2 ServiceLevel NH - rate found should be $.18 from weight 151 - 299.99
Weight - 558.9126 Zone 2 ServiceLevel NH - rate found should be $.15 from weight 500 - 999.99
Weight - 5686.9604 Zone 2 ServiceLevel NH - rate found should be $.10 from weight 5000 - 9999.99
The problem I am having is I am only getting the rate if it matches exactly i.e. 499.99, which almost never happens. What I tried to do was put the following criteria in a query on the Max Weight - Between [Forms]![frmShipment].[Form]![txtWeight] And [Forms]![frmShipment].[Form]![txtWeight], no rates are returned (have tried against MinWeight as well, same result).
The only way I have been able to come up with a solution is to have a rate for each weight, zone, and service level, which would create thousands of extra records. Obviously not real practical.
Any help would be greatly appreciated. Thanks very much in advance.
I have a database that is used to determine shipping rates based on multiple factors. I am trying to determine what the weight break would be when given a shipment weight. Below is the table layout and an example of what I am looking to get.
Table
MinWgt MaxWgt Zone Rate Minimum ServiceLevel
151 299.99 2 $0.18 $72.00 NH
300 499.99 2 $0.16 $72.00 NH
500 999.99 2 $0.15 $72.00 NH
1000 1999.99 2 $0.14 $72.00 NH
2000 4999.99 2 $0.12 $72.00 NH
5000 9999.99 2 $0.10 $72.00 NH
There are multiple zones and service levels, such as Zones 1-10 with up to 6 different service levels for each.
Examples
Weight - 464.0731 Zone 2 ServiceLevel NH - rate found should be $.16 from weight 300 - 499.99
Weight - 151.0966 Zone 2 ServiceLevel NH - rate found should be $.18 from weight 151 - 299.99
Weight - 558.9126 Zone 2 ServiceLevel NH - rate found should be $.15 from weight 500 - 999.99
Weight - 5686.9604 Zone 2 ServiceLevel NH - rate found should be $.10 from weight 5000 - 9999.99
The problem I am having is I am only getting the rate if it matches exactly i.e. 499.99, which almost never happens. What I tried to do was put the following criteria in a query on the Max Weight - Between [Forms]![frmShipment].[Form]![txtWeight] And [Forms]![frmShipment].[Form]![txtWeight], no rates are returned (have tried against MinWeight as well, same result).
The only way I have been able to come up with a solution is to have a rate for each weight, zone, and service level, which would create thousands of extra records. Obviously not real practical.
Any help would be greatly appreciated. Thanks very much in advance.