The long‐term dynamics of Oort cloud comets are studied under the influence of both the radial and the vertical components of the Galactic tidal field. Sporadic dynamical perturbation processes, such as passing stars, are ignored since we aim to study the influence of just the axisymmetric Galactic tidal field on the cometary motion and how it changes in time. We use a model of the Galaxy with a disc, bulge and dark halo, and a local disc density and disc scalelength constrained to fit the best available observational constraints. By integrating a few million of cometary orbits over 1 Gyr, we calculate the time variable flux of Oort cloud comets that enter the inner Solar system for the cases of a constant Galactic tidal field and a realistically varying tidal field, which is a function of the Sun's orbit. The applied method calculates the evolution of the comets by using first‐order averaged mean elements. We find that the periodicity in the cometary flux is complicated and quasi‐periodic. The amplitude of the variations in the flux is of the order of 30 per cent. The radial motion of the Sun is the chief cause of this behaviour, and should be taken into account when the Galactic influence on the Oort cloud comets is studied.