Error Using Date Field in Database Query Using ODBC

ID: Q110215

The information in this article applies to:

SYMPTOMS

In Word version 6.0 for Windows, an error message or an incorrect date formats generated when you specify a date/time field as part of a database query using ODBC.

CAUSE

Word passes dates and times to the ODBC drivers in an incorrect format.

STATUS

Microsoft has confirmed this to be a problem in Word for Windows versions 6.0, 6.0a, and 6.0c. This problem was corrected in Word version 7.0 for Windows 95.

WORKAROUND

To work around this problem:

MORE INFORMATION

Example of Problem and Error Message

You want to retrieve customer orders placed in 1994. When you choose Query Options from either Insert Database or Tools Mail Merge and specify to retrieve records where OrderDate is greater than 12/31/93, you receive an ODBC error message similar to the following:

   ODBC ERROR:
   Stop -- Syntax Error

Choosing OK results in:

   ODBC ERROR
   Stop -- SELECT "OrderDate", "OrderID" FROM "ORDERS" WHERE (("OrderDate"
   > #12<<???>>/31/93#))

Choosing Details results in:

   ODBC ERROR:[Microsoft][ODBC Single-Tier Driver]
   Stop -- SELECT "OrderDate","OrderID" FROM "ORDERS" WHERE (("OrderDate" >
   #12<<???>>/31/93#))

KBCategory: kbusage buglist6.0 buglist6.0a buglist6.0c fixlist7.0 KBSubcategory: Additional query words: 6.0 b_waccess foxpro access word6 6.0a 6.0c winword
Version           : 6.0 6.0a 6.0c
Platform          : WINDOWS

Last Reviewed: February 5, 1998