G
Guest
I maintain a database of contract pay rates for my firm. We use the data to
determine the starting point to contract negotiations with consultants. Our
current MO is to have an advisor send me a request to find out what the
average rate would be for workers where the industry is Law Enforcement, the
job category is Administrative or Finance and the job is located in Region
One or Florida. Once I have the answer(s) I drop it in an Excel sheet and
send it back.
The SQL may make the question clearer:
SELECT tIndustry.Industry, tCategory.txtCategory, tMRM.dblBillRate,
tMRM.dblPayRate, tMRM.lngOrderID, tMRM.txtJobTitle, tRegions.City,
tRegions.State, tRegions.Region, ([dblBillRate]/[dblPayRate])-1 AS MarkUp,
IIf([MarkUp]>1,"Exclude-High",IIf([MarkUp]<0.3,"Exclude-Low","Include")) AS
Flag, sqFinancial.CountOfID
FROM tCategory RIGHT JOIN (tIndustry INNER JOIN (tClient INNER JOIN ((tMRM
INNER JOIN tRegions ON (tMRM.txtState = tRegions.State) AND (tMRM.txtCity =
tRegions.City)) INNER JOIN sqFinancial ON tMRM.txtJobTitle =
sqFinancial.txtJobTitle) ON tClient.ID = tMRM.lngClient) ON tIndustry.ID =
tClient.lngIndustry) ON tCategory.ID = tMRM.lngPrOCategory
WHERE (((tIndustry.Industry)="Law Enforment") AND
((tCategory.txtCategory)="Administrative" Or
(tCategory.txtCategory)="Finance") AND ((tRegions.State)="FL")) OR
(((tIndustry.Industry)="Law Enforment") AND
((tCategory.txtCategory)="Administrative" Or
(tCategory.txtCategory)="Finance") AND ((tRegions.Region)=1));
I want to create a form that allows the users to select regions, if any, the
states, if any, job categories, etc. But I don’t how to create a SQL
statement where there could be one limit or ten limits, depending on the
request. I imagine there has to be a way to do this, but I am not sure where
to start.
All that being said, is this even the best way to approach the problem. I
want the users to be able extract the data themselves, but do it in a way
that is intuitive and simple. Alternate suggestions welcome!
Thanks in advance,
PJ
determine the starting point to contract negotiations with consultants. Our
current MO is to have an advisor send me a request to find out what the
average rate would be for workers where the industry is Law Enforcement, the
job category is Administrative or Finance and the job is located in Region
One or Florida. Once I have the answer(s) I drop it in an Excel sheet and
send it back.
The SQL may make the question clearer:
SELECT tIndustry.Industry, tCategory.txtCategory, tMRM.dblBillRate,
tMRM.dblPayRate, tMRM.lngOrderID, tMRM.txtJobTitle, tRegions.City,
tRegions.State, tRegions.Region, ([dblBillRate]/[dblPayRate])-1 AS MarkUp,
IIf([MarkUp]>1,"Exclude-High",IIf([MarkUp]<0.3,"Exclude-Low","Include")) AS
Flag, sqFinancial.CountOfID
FROM tCategory RIGHT JOIN (tIndustry INNER JOIN (tClient INNER JOIN ((tMRM
INNER JOIN tRegions ON (tMRM.txtState = tRegions.State) AND (tMRM.txtCity =
tRegions.City)) INNER JOIN sqFinancial ON tMRM.txtJobTitle =
sqFinancial.txtJobTitle) ON tClient.ID = tMRM.lngClient) ON tIndustry.ID =
tClient.lngIndustry) ON tCategory.ID = tMRM.lngPrOCategory
WHERE (((tIndustry.Industry)="Law Enforment") AND
((tCategory.txtCategory)="Administrative" Or
(tCategory.txtCategory)="Finance") AND ((tRegions.State)="FL")) OR
(((tIndustry.Industry)="Law Enforment") AND
((tCategory.txtCategory)="Administrative" Or
(tCategory.txtCategory)="Finance") AND ((tRegions.Region)=1));
I want to create a form that allows the users to select regions, if any, the
states, if any, job categories, etc. But I don’t how to create a SQL
statement where there could be one limit or ten limits, depending on the
request. I imagine there has to be a way to do this, but I am not sure where
to start.
All that being said, is this even the best way to approach the problem. I
want the users to be able extract the data themselves, but do it in a way
that is intuitive and simple. Alternate suggestions welcome!
Thanks in advance,
PJ