Question
Urgent help - SQL query and table/query structures - WILL PAY
Going round in circles with this and have spent almost a week
trying to
solve it, with no joy so far. I'm happy to pay someone to help me make
sense of my tables, queries and relationships.
Tables are as follows (sample data, and field type, in brackets):
tblOrders
orderID (1 - PK)
pickupregion (10 - int - FK)
deliveryregion (10 - int - FK)
tblRegions
regionID (10 - PK)
regionname (London - text)
tblVanDrivers
vandriverID (1 - PK)
name (Joe Bloggs - text)
address (High Street - text)
tblVanDriverOperatingAreas
operatingareaID (1 - PK)
vandriverID (1 - FK)
allengland (1 - int)
allscotland (2 - int)
allwales (3 - int)
withinM25 (7 - int)
northeatengland (8 - int)
I need to display a list of orders that match the operating areas selected
by any one van driver. For example, if a van driver selects "withinM25" as
their preferred operating area, then I'd only want them to be able to view
jobs in that region. Similarly, if the van operator chooses "All England"
then I'd also need to display the jobs "withinM25" as this would also
qualify.
Have I gone about creating my tables in the wrong way?
If I allowed the van operators to select regions, rather than operating
areas, then my problem would be solved as I understand how to do that,
however it's the operating areas that are giving me grief because I don't
know how to relate them to anything else.
Also, I would like to keep the tblVanDrivers and tblVanDriverOperatingAreas
in seperate tables.
Like I say, I'm happy to pay someone for an hours time in order to solve
this riddle that it doing my head in!
Thanking you in advance.
Regards
Nath.
I want to be able to display a list of orders that match a van operators
chosen operating areas.
solve it, with no joy so far. I'm happy to pay someone to help me make
sense of my tables, queries and relationships.
Tables are as follows (sample data, and field type, in brackets):
tblOrders
orderID (1 - PK)
pickupregion (10 - int - FK)
deliveryregion (10 - int - FK)
tblRegions
regionID (10 - PK)
regionname (London - text)
tblVanDrivers
vandriverID (1 - PK)
name (Joe Bloggs - text)
address (High Street - text)
tblVanDriverOperatingAreas
operatingareaID (1 - PK)
vandriverID (1 - FK)
allengland (1 - int)
allscotland (2 - int)
allwales (3 - int)
withinM25 (7 - int)
northeatengland (8 - int)
I need to display a list of orders that match the operating areas selected
by any one van driver. For example, if a van driver selects "withinM25" as
their preferred operating area, then I'd only want them to be able to view
jobs in that region. Similarly, if the van operator chooses "All England"
then I'd also need to display the jobs "withinM25" as this would also
qualify.
Have I gone about creating my tables in the wrong way?
If I allowed the van operators to select regions, rather than operating
areas, then my problem would be solved as I understand how to do that,
however it's the operating areas that are giving me grief because I don't
know how to relate them to anything else.
Also, I would like to keep the tblVanDrivers and tblVanDriverOperatingAreas
in seperate tables.
Like I say, I'm happy to pay someone for an hours time in order to solve
this riddle that it doing my head in!
Thanking you in advance.
Regards
Nath.
I want to be able to display a list of orders that match a van operators
chosen operating areas.
