The quality of written prescriptions has not been examined in a psychiatric setting. The aim of this study was to examine the quality of drug prescribing by medical staff for elderly patients hospitalized with dementia in comparison with the quality of prescribing for elderly patients hospitalized for functional psychiatric illness (depression, anxiety and psychosis). We studied a cohort of 112 elderly psychiatric inpatients in two hospitals over a seven-year period. A standardized assessment sheet was used to assess 320 prescriptions of psychotropic drugs, using medical notes and drug charts. Patients with dementia and functional illness were defined by ICD-9 or ICD-10 criteria. Severity of illness was measured by the presence or absence of symptoms in six discrete symptom clusters. Two raters examined prescription quality. Twenty percent of prescriptions for patients with dementia were illegible, significantly higher than in functional illness. In both groups, among prescriptions of regular medication, one third contained missing information on either, dose, intended frequency, or, indications for use. Among prescriptions for as-required medication, two-thirds of prescriptions contained this missing information. Prescriptions were legible and free of all errors in only 20 of 112 cases (18%). Quality of as-required medication prescribing was inferior to the prescription of regular medication, particularly for dementia patients. In addition, prescribing for patients with dementia carried significantly more errors in notation of dose than prescribing for patients with functional illness. We conclude that errors are common in prescribing for elderly psychiatric patients, particularly for as-required medication and for patients with dementia.