Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Using wildcard characters as literal characters [Table of Contents] Chapter 5 Reserved Words

Reference Manual Volumes 1 - 4 (Online Only)

[-] Chapter 4 Expressions, Identifiers, and Wildcard Characters
[-] Pattern matching with wildcard characters
[-] Using wildcard characters with datetime data

Using wildcard characters with datetime data

When you use like with datetime values, Adaptive Server converts the dates to the standard datetime format, then to varchar. Since the standard storage format does not include seconds or milliseconds, you cannot search for seconds or milliseconds with like and a pattern.

It is a good idea to use like when you search for datetime values, since datetime entries may contain a variety of date parts. For example, if you insert the value "9:20" and the current date into a column named arrival_time, the clause:

where arrival_time = '9:20'

would not find the value, because Adaptive Server converts the entry into "Jan 1 1900 9:20AM." However, the following clause would find this value:

where arrival_time like '%9:20%'


Using wildcard characters as literal characters [Table of Contents] Chapter 5 Reserved Words