Yes you can do that. The confidence interval will return you the range in terms of dollars. That is, 95% of salaries lie within X on the low end, and Y on the high end. In this case the firm's secretaries are below X so they arguably deserve more compensation. An important assumption you are making in that process is that the standard deviation (840) from your sample holds true for the city as well. That is, you know that the salaries in the company have a standard deviation of 840, but through the CI calculation it is presumed the city also has a secretary salaray standard devaition of 840 as well. That is, you will plug in 840 for $\sigma$, which is the population standard deviation. The population being all secretaries in the city.
Alternatively you could calculate the difference between the means. $42100-38300 = 3800$ and then divide that by your SD = 840. $3800 / 840 = 4.52$ This 4.52 is the number of standard deviations from the mean. Keep in mind, in this case, you are assuming that both samples, have the same standard deviation as well, that is 840. However, again we don't actually know the standard deviation of the population. As a rule of thumb 3 standard deviations away from the mean is %99.7 and 2 standard deviations away is 95%.
The main point here being, a confidence interval is only converting your standard deviation into the original units, in this case the dollars of a salary. So both of these approaches are doing the same process, just presenting the results in different units. Whether you call it six inches or half a foot, both 15.24 centimeters.