Q:

Is "any time between X happened and Y happened" correct?

What I'm actually trying to say is 

This problem would also occur if someone started buying a ticket any time between the data was collected and it was published.

Or would it be 

This problem would also occur if someone started buying a ticket any time between the time the data was collected and it was published.

Is there a better way to say this?

A:

The first sentence needs to be 

This problem would also occur if someone started buying a ticket any
  time between when the data was collected and when it was published.

The second sentence is okay spoken, but it's a little awkward for someone taking the time to write it out; I think this is better

This problem would also occur if someone started buying a ticket
  between data collection and data publication.

Fewer filler words between the important parts, which are the definitions of the two time endpoints.
or 

This problem would also occur if someone started buying a ticket
  during the interval between data collection and data publication.

