Working with Valid date ranges

Stildawn

Board Regular
Joined
Aug 26, 2012
Messages
197
Hi All

Working on building a Freight Rate database in Access.

I have the attached so far, and for form (Test Form) works as intended, however it doesnt take into account the valid from/valid to fields on each record.

Basically need the below:
- FRT_Table, holds individual freight rates as records
- FRT_Additionals_Table holds individual additional costs that need to be added to the freight rates in FRT_Table
- Locals_Table holds individual local costs that need to be showing on the bottom of the form (test form) when a freight record is selected in the list box

- Each of the tables records have a valid from/valid to date
- The listbox in the Test Form, needs to show relevant freight records (from FRT_Table), and then for columns "20GP All In" / "40GP All In" / "40HC All In" it needs to add the Freight rates from FRT_Table + all the relevant additionals from FRT_Additionals_Table (BAF/GRI/PSS/MISC) to create a "All In" cost. So 20GP All In = 20GP Cost (FRT_Table) + 20GP BAF (FRT_Additionals_Table) + 20GP GRI (FRT_Additionals_Table) + 20GP PSS (FRT_Additionals_Table) + 20GP MISC (FRT_Additionals_Table)

- However it needs to check the valid from/to dates of the freight record and make sure it adds the correct FRT_Additionals based on their valid dates.

- The valid from/to dates on any of the tables can be any date, they are not set periods (e.g 1 month) it could be any set of dates.

Anyone able to help me on this?

Thanks
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Make a form that has 2 text boxes....txtStartDate, txtEndDate.
The base query Q1 pulls this via:
Select * from table where [datefield] between forms!fMyForm!txtStartDate and forms!fMyForm!txtEndDate.

Then in another query, Q2,use Q1 joined to other tables to wet more data.
 
Upvote 0
Thanks, not sure how this would work for this project.

The user form has two options currently.

All valid rates from today() onwards
All rates including expired rates

So the user doesnt enter in the dates they want.

If the userform shows a bunch of records can I somehow filter another query in the background based on each record shown in the listbox? And then pull the data needed from that query? But would need to be a query for each record shown I think which could be many many records.
 
Upvote 0

Forum statistics

Threads
1,214,864
Messages
6,121,981
Members
449,058
Latest member
oculus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top