JimLecocq
12-04-2007, 08:21 AM
I may be barking up the wrong tree here but I wanted to see if there is an easier solution. I am getting better with Access and VB but I still have a ways to go.
I have a database and in it there are columns (integers) that have to be multiplied by a factor, at this point one by .38 the other .18 and one by .17, these factors change from time to time. This occurs in several queries. I could mark all the queries and change the factors one at a time but I wondered if a constant would take care of the problem. I thought about running it from VB but I have had a problem getting that to work also. Any suggestions? The place where the problem occurs I have colored red as you can probably see. I guess what I am looking for is a way to change these factors all at one time probably calling them DM, MM, and PT. We used to use Excel and had a criteria workbook that all the other files referenced. All I had to do was change it in the criteria workbook. Below is just one of the simpler queries.
SELECT tblCallsbyDay.Date, tblCallsbyDay.DM, tblCallsbyDay.MM, tblCallsbyDay.PT, tblCallsbyDay.DM+tblCallsbyDay.MM+tblCallsbyDay.PT AS TotalCalls,
[tblCallsbyDay.DM]*0.37 AS DMGoal, [tblCallsbyDay.MM]*0.18 AS MMGoal, [tblCallsbyDay.PT]*0.17 AS PTGoal,
DMGoal+MMGoal+PTGoal AS CallsGoalDay
FROM tblCallsbyDay
GROUP BY tblCallsbyDay.Date, tblCallsbyDay.DM, tblCallsbyDay.MM, tblCallsbyDay.PT;
I have a database and in it there are columns (integers) that have to be multiplied by a factor, at this point one by .38 the other .18 and one by .17, these factors change from time to time. This occurs in several queries. I could mark all the queries and change the factors one at a time but I wondered if a constant would take care of the problem. I thought about running it from VB but I have had a problem getting that to work also. Any suggestions? The place where the problem occurs I have colored red as you can probably see. I guess what I am looking for is a way to change these factors all at one time probably calling them DM, MM, and PT. We used to use Excel and had a criteria workbook that all the other files referenced. All I had to do was change it in the criteria workbook. Below is just one of the simpler queries.
SELECT tblCallsbyDay.Date, tblCallsbyDay.DM, tblCallsbyDay.MM, tblCallsbyDay.PT, tblCallsbyDay.DM+tblCallsbyDay.MM+tblCallsbyDay.PT AS TotalCalls,
[tblCallsbyDay.DM]*0.37 AS DMGoal, [tblCallsbyDay.MM]*0.18 AS MMGoal, [tblCallsbyDay.PT]*0.17 AS PTGoal,
DMGoal+MMGoal+PTGoal AS CallsGoalDay
FROM tblCallsbyDay
GROUP BY tblCallsbyDay.Date, tblCallsbyDay.DM, tblCallsbyDay.MM, tblCallsbyDay.PT;