EXHIBIT 5 July 9, 1997 Sandata, Inc, 26 Harbor Park Drive Port Washington, New York 11050 Re: Registration of 1,644,445 Common Shares, par value $.001 per share, under the Securities Act of 1933, as amended Gentlemen: In our capacity as counsel to Sandata, Inc., a Delaware corporation (the "Company"), we have been asked to render this opinion in connection with a Registration Statement on Form S-8 being filed contemporaneously herewith by the Company with the Securities and Exchange Commission under the Securities Act of 1933, as amended (the "Registration Statement"), covering an aggregate of 1,644,445 Common Shares, par value $.001 per share, of the Company (the "Shares") to be issued upon the exercise of options to acquire Common Shares granted under the Company's Employees' Incentive Stock Option Plan, 1986 Non-Qualified Stock Option Plan and 1995 Stock Option Plan (the "Plans"). In that connection, we have examined the Certificate of Incorporation and the ByLaws of the Company, each as amended, the Registration Statement and the Plans and are familiar with corporate proceedings of the Company relating to the adoption of each of the Plans. We have also examined such other instruments and documents as we deemed relevant under the cir cumstances. For purposes of the opinions expressed below, we have assumed (i) the authenticity of all documents submitted to us as original, (ii) the conformity to the originals of all documents submitted as certified, photostatic or facsimile copies and the authenticity of the originals, (iii) the legal capacity of natural persons, (iv) the due authorization, execution and delivery of all documents by all parties and the validity and binding effect thereof and (v) the conformity to the proceedings of the Board of Directors of all minutes of such proceedings. We have also assumed that the corporate records furnished to us by the Company include all corporate proceedings taken by the Company to date. Sandata, Inc. July 9, 1997 Page 2 Based upon and subject to the foregoing, we are of the opinion that the Shares have been duly and validly authorized and, when issued and paid for as described in each of the Plans, will be duly and validly issued, fully paid and nonassessable. We hereby consent to the use of our opinion as herein set forth as an exhibit to the Registration Statement. This opinion is as of the date hereof, and we do not undertake, and hereby disclaim, any obligation to advise you of any changes in any of the matters set forth herein. We are rendering this opinion only as to the matters expressly set forth herein, and no opinion should be inferred as to any other matters. This opinion is for your exclusive use only and is to be utilized and relied upon only in connection with the matters expressly set forth herein. Very truly yours, /s/ Certilman Balin Adler & Hyman, LLP CERTILMAN BALIN ADLER & HYMAN, LLP