Reference·DTP Segment·DTP02
X12 834 Reference

DTP02 in X12 834: A Field Guide to Date Time Period Format Qualifier

Jul 28, 2026 · 4 min read
← DTP01 DTP03 →

DTP03 is just a string of digits until DTP02 tells the parser how to read it.

Quick answer

DTP02 states the format that the date value in DTP03 is written in. On an 834 coverage-begins or coverage-ends occurrence this is almost always a single calendar date, but the field exists precisely because DTP is reused across many contexts where a different shape of value might show up, so a parser should read DTP02 rather than assume.

Common values you'll see in practice

D8
Date (CCYYMMDD) — a single eight-digit calendar date — what nearly every 834 coverage date uses
RD8
Range of Dates (CCYYMMDD-CCYYMMDD) — two dates separated by a dash, occasionally used where a date span rather than a single day applies

Example

Synthetic example Generated by Synthibase
DTP*348*D8*20260901

A synthetic DTP where DTP02=D8 tells the parser that DTP03 is one eight-digit date rather than a range, so 20260901 should be read as September 1, 2026.

Where this trips people up

Because D8 covers the overwhelming majority of real-world 834 coverage dates, it's common for a parser to be built with the date format hardcoded and DTP02 never actually checked. That works fine until a trading partner sends an RD8 range on some other DTP occurrence in the same file, or a malformed file has the wrong qualifier in this position, and the hardcoded parser either throws an unhandled error or, worse, silently truncates the value. Include at least one RD8 case and one deliberately mismatched DTP02/DTP03 pair in your test data so the parser's format handling actually gets exercised.

X12 834 DTP Segment Guide: Fields, Format, and Testing Gotchas
EDI 834 Enrollment File: Format and Testing Guide
How to Write EDI Test Cases That Actually Catch Go-Live Failures
Test date formats your parser doesn't expect
Synthibase generates synthetic 834 files that mix D8 single dates with less common format qualifiers, so format-handling logic gets tested against more than the one shape every fixture usually assumes.
Start free trial →
This page is written independently by Synthibase for testing and informational purposes. It is not an official publication of HL7 International or X12/Washington Publishing Company, and is not a substitute for reviewing the official standard or your trading partner's companion guide. See our Terms of Service for full legal terms.