Prescription databases are increasingly used in epidemiological studies concerning the use and the effects of drugs. However, this source of data does not provide direct observations of the time of initiation and discontinuation of drug treatment, and these time points therefore need to be estimated. The paper investigates the validity of methods that are used in the literature to identify discontinuation of treatment from prescription data, and we consider the example of post-menopausal hormone therapy. Validation is investigated in terms of a simulation study based on a multistate model for the relationship between episodes of treatment with hormone therapy and occurrence of prescription refills. The multistate model that is introduced is estimated from joint observations of a prescription registry and a cross-sectional survey, involving techniques from the analysis of backward recurrence times. We demonstrate that estimated time points of discontinuation of treatment are highly uncertain, and this may influence studies concerning the immediate effect of discontinuation of treatment. Despite this limitation, we find that a valid assessment of current treatment status (never, current or previous drug use) can be obtained from prescription data. Copyright (c) 2010 Royal Statistical Society.