What does HRESULT 0x00040947 (IDS_MON_DATE_OUT_OF_RANGE) mean?

 
Previous Next
IDS_MON_CANNOT_CAST IDS_MON_INVALID_IN_GROUP_CLAUSE

IDS_MON_DATE_OUT_OF_RANGE

IDS_MON_DATE_OUT_OF_RANGE indicates that relative-date syntax is structurally recognized but the requested interval is too large. Windows Search DATEADD accepts units from YEAR through SECOND and a negative integer offset applied to GETGMTDATE or another DATEADD result.

Validate the computed interval before emitting SQL

  • Log the unit and signed offset after converting application durations.
  • Check integer overflow when converting days to hours, minutes, or seconds.
  • For compound intervals, use nested DATEADD calls instead of multiplying one unit into an extreme offset.

The function is intended to obtain dates and times before the present and explicitly requires negative offsets. Very large values can also push the calculated timestamp outside the supported date representation. A robust query builder should range-check the application duration before SQL generation and reject or cap impossible search windows with an explicit application error.

DATEADD function · Date literals · Parser messages


Looking for a different code? Search another status or error code.