Compare means between samples, while controlling for sampling differences - valid to use regression this way? There are two independent samples of people, drawn from a population of a city at times $t_1$ and $t_2$, a decade apart*. The people were asked rate their preference regarding some question $Q$ on a scale of 1...10, as well as report their age and sex. The research question is, has average preference towards $Q$ changed in the city over time.

However, the sample composition varies somewhat between the two measurement time points in terms of both sex ratios and ages represented in the sample. The issue is therefore comparing means of $Q$ between the two temporal samples in a way that controls for sampling differences. E.g., in case say old men are thought to give a higher $Q$ rating, and there are slightly more older people and slightly more men in the $t_2$ sample, the the mean might look higher than in $t_1$ - but it might be really just an effect of having more old dudes in there. So it seems I can't just run a simple t-test.
Here is an attempt: concatenate data from the two samples and record time {$t_1, t_2$} as a variable, build two regression models predicting the $Q$ rating, with age and sex as control variables, one model has time as a categorical predictor, and the other doesn't.
model a: $Q \sim age ~+~sex $
model b: $Q \sim age ~+~sex ~+~time $
...and then compare the models to see if time adds descriptive power to the model (could also run cross-validation, compare prediction error, etc.). The idea is, if model b performs significantly better, then the differences between the two temporal samples must be significant too, after controlling for differences in sampling. So, for example, if mean $Q$ rating is a point higher in $t_2$ - but model b is not an improvement over model a - then I would conclude that the apparent "increase" is just a sampling effect.
Bottom line question: does this make sense? If not, why, and is there a better way to answer this sort of a research question?


* So technically, two samples from two different populations. There are only these two samples in the dataset, not any longer time series; and there are no overlaps in terms of participants, i.e. not that q; the sample sizes are almost the same, i.e. not that q. The differences between sex&age ratios are assumed to stem from sampling issues, not because of major changes in the city population in terms of sex ratio or age composition.
 A: Don't jump the gun - clear research question first, statistical model after
Before you get to the point where you decide on your statistical test, you have to be careful to clearly frame the question you actually want to ask, and the sampling method that was used to get your data.  One thing you are missing in your framing of the question is that the demographic composition of a city can change substantially over a decade, so it is entirely possible that the change in age/sex composition in your data reflects an actual change in the demographic composition of the city, rather than an aspect of the sampling.  In order to determine which of these two things has led to the different demographic composition of the sample, you will need to clearly review the sampling method, and seek outside data on the demographic composition of the city over time (e.g., from census data).
You say that you want to detect a change in preference "in the city", which is fine.  But remember that "the city" is not a fixed set of people --- it is a composition of people that changes over time.  If you want to know whether the aggregate preference of that changing composition of people is changing then it is a bad idea to "control" for age and sex.  That would be tantamount to filtering out effects due to the change in composition in the city, which is a real aspect of the new composition of the city.  Alternatively, if you decide you want to filter out these effects via statistical methods, then you need to adjust your research question to reflect the fact that you are filtering out that part of the change in preference that is due to changing demographic composition of the city.  Either of these research questions might potentially be interesting, depending on what you want to know.
Most importantly, it is wrong to assume that changes in the age/sex composition in your samples is purely an artefact of your sampling (as opposed to reflecting underlying changes in the demographic composition of the city).  Consequently, it is wrong to conclude that controlling for age/sex is equivalent to controlling for sampling error in the composition.
A: This does not appear to be the best way to test your hypothesis. In fact, there is a very simple way to test your hypothesis:
You should just run model b, where time is a dummy variable indicating whether you are in the second time period. Then you can test whether the coefficient on time is significantly different from zero, just using a simple t test.
Of course, the controls (age, sex, etc) you include matter, they should capture all the relevant differences in sampling.
More importantly, note that this procedure will test a slightly different hypothesis: Whether, conditional on your controls the average preference has changed. 
For example, let's say for comparable persons, attitudes towards Q have not changed at all. Thus, running model B will result in an estimate of approximately zero. Probably this is the effect you are interested in.
However, say old people like Q much more than young people. If average age goes up a lot, average attitudes will thus improve. If you want to include those indirect effect in your estimates (as your questions suggests), you can insert the average values at t1 (for age and sex) into model B (with estimated coefficients) and thus calculate the conditional expectation at time t1 (insert zero for time). Note that these should not be the averages in your sample but rather in the population (so look them up somewhere else). Compare that to inserting the averages for time t2 and inserting time=1. This is the best estimate of how the average attitude has changed over time.
