NinjaForce
05-25-2008, 11:34 PM
I am building a timesheet which requires the employee to select three codes for costing. The choices are to come from a flat table of three costcode fields - it has to be a flat table to allow for import from another program.
The first choice relates to the client (or contract), the second a project, and the third a category. Not each client has the same set of projects, and not each project has the same set of categories.
I need to give the employees a simle drop-down box to choose the client, and then another drop-down box that only gives the options available based on the choice made in the client (contract) field.
I have the query on the first field in the timesheet looking up the costcode table using SELECT DISTINCT, which narrows their choice down to two (only two clients at present in the table). It's the next part that I am stuck on....
I know I need a SELECT FROM WHERE statement but am unsure of the correct syntax. eg:
SELECT CostCodes.Project
FROM CostCodes
WHERE CostCodes.Contract=TimeSheet.Contract;
Can anyone help me with the syntax?
The first choice relates to the client (or contract), the second a project, and the third a category. Not each client has the same set of projects, and not each project has the same set of categories.
I need to give the employees a simle drop-down box to choose the client, and then another drop-down box that only gives the options available based on the choice made in the client (contract) field.
I have the query on the first field in the timesheet looking up the costcode table using SELECT DISTINCT, which narrows their choice down to two (only two clients at present in the table). It's the next part that I am stuck on....
I know I need a SELECT FROM WHERE statement but am unsure of the correct syntax. eg:
SELECT CostCodes.Project
FROM CostCodes
WHERE CostCodes.Contract=TimeSheet.Contract;
Can anyone help me with the syntax?