Negative Number in Query Incorrect When Returned to Worksheet

ID: Q117313

1.00 WINDOWS kbother

The information in this article applies to:

SYMPTOMS

In Microsoft Excel, when you return data from a query in Microsoft Query, negative numbers are returned as positive numbers. For example, the value - 1 in Microsoft Query is returned as 65535, the value -2 is returned as 65534, and so on.

CAUSE

This error occurs when you return data from a column of field type TINYINT or SMALLINT (SQL table), or SHORT (Paradox table). The error occurs because Microsoft Excel assumes these INT data types are unsigned, but Microsoft Query assumes they are signed.

You cannot return negative numbers in Microsoft Excel from columns of type TINYINT, SMALLINT, or SHORT.

WORKAROUNDS

To return negative values from Microsoft Query to a Microsoft Excel worksheet, do either of the following:

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Excel version 5.0c for Windows.

MORE INFORMATION

In Microsoft Excel, you can link to data in an external database by choosing Get External Data from the Data menu. This command starts Microsoft Query, and allows you to use a data source to build a query. You can then choose the Return Data To Microsoft Excel command on the File menu in Microsoft Query to return the query data to your worksheet.

KBCategory: kbother KBSubcategory: xlquery kbtool

Additional reference words: 1.00 5.00

Keywords          : kbtool xlquery 
Version           : 1.00
Platform          : WINDOWS

Last Reviewed: September 15, 1996