We introduce a method to constrain general cosmological models using Baryon Acoustic Oscillation (BAO) distance measurements from galaxy samples covering different redshift ranges, and apply this method to analyse samples drawn from the Sloan Digital Sky Survey (SDSS) and 2dF Galaxy Redshift Survey (2dFGRS). BAOs are detected in the clustering of the combined 2dFGRS and SDSS main galaxy samples, and measure the distance–redshift relation at z= 0.2. BAOs in the clustering of the SDSS luminous red galaxies measure the distance–redshift relation at z= 0.35. The observed scales of the BAOs calculated from these samples and from the combined sample are jointly analysed using estimates of the correlated errors, to constrain the form of the distance measure DV(z) ≡[(1 +z)2D2Acz/H(z)]1/3. Here DA is the angular diameter distance, and H(z) is the Hubble parameter. This gives rs/DV(0.2) = 0.1980 ± 0.0058 and rs/DV(0.35) = 0.1094 ± 0.0033 (1σ errors), with a correlation coefficient of 0.39, where rs is the comoving sound horizon scale at recombination. Matching the BAOs to have the same measured scale at all redshifts then gives DV(0.35)/DV(0.2) = 1.812 ± 0.060. The recovered ratio is roughly consistent with that predicted by the higher redshift Supernova Legacy Survey (SNLS) supernova data for Λ cold dark matter cosmologies, but does require slightly stronger cosmological acceleration at a low redshift. If we force the cosmological model to be flat with constant w, then we find Ωm= 0.249 ± 0.018 and w=−1.004 ± 0.089 after combining with the SNLS data, and including the WMAP measurement of the apparent acoustic horizon angle in the cosmic microwave background.