Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wildcard characters in TSQL
Message
 
 
To
27/02/2004 16:58:02
Alvin Lourdes
Children and Youth Services Cluster
Toronto, Ontario, Canada
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00881697
Message ID:
00881716
Views:
28
Yes, The LIKE operator in SQLECT supports "%" and "_" wlidcard characters. "%" means any set of characters, "_" - any one character. See BOL for details.
If the 'date' column is a character type than
SELECT * FROM CUSTOMER WHERE DATE LIKE '2/%/200_'
If your 'date' field is a datetime than you can use DATEPART() function.
SELECT * FROM CUSTOMER 
  WHERE DATEPART(year, [date]) >= 2000 
    AND DATEPART(mm, [date]) = 2
>Is there a way to use wildcard characters in an sql statement.
>
>ie: SELECT * FROM CUSTOMER WHERE DATE LIKE '2/**/200*'
>
>I want the ** to be wildcard characters..
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform