INFO: DFW Filter on Char Datatype Results in No Records Found (189201)
The information in this article applies to:
- Microsoft Visual InterDev 1.0
- Microsoft Active Server Pages
- Microsoft Internet Information Server 4.0
- Microsoft Internet Information Server 5.0
This article was previously published under Q189201 SUMMARY
Using the Data Form Wizard with a field of char datatype can result in no
records found when filtered. This happens when the string used to filter is
not the exact length specified for the char datatype field in the SQL
Server table.
With SQL Server, a char datatype has a specific character length and every
piece of data put into that field must have that length. If it does not
have that length, it is in essence padded with trailing spaces to make it
the specified length. On the other hand, the varchar datatype also has a
specific character length, but it allows the contents of the field to be
less than or equal to that length.
When filtering in the Data Form Wizard the filter value is truncated of all
leading or trailing spaces and therefore if it contains fewer characters
than the specified char type length, no matches will be found. By changing
the datatype of the field to varchar the same filter will return records.
Modification Type: | Minor | Last Reviewed: | 3/7/2005 |
---|
Keywords: | kbDatabase kbinfo KB189201 |
---|
|