This topic discusses the conventions you must use when entering the following types of literal values for a
Note The information in this topic is derived from the rules for standard SQL-92. If you have questions about how to enter search values, see the Transact-SQL Reference.
The following guidelines apply when you enter text values in search conditions:
'Smith'
If you are entering a search condition in the Grid pane, you can simply type the text value and the Query Designer will automatically put single quotation marks around it.
Note In SQL Server, the Query Designer always interprets double quotation marks as database object delimiters. For details, see Query Designer Considerations for SQL Server Databases.
='Swann''s Way'
If you are unsure about whether the database uses a case-sensitive search, you can use the UPPER or LOWER functions in the search condition to convert the case of the search data, as illustrated in the following example:
WHERE UPPER(lname) = 'SMITH'
For details about the functions to convert to uppercase and lowercase letters, see Functions for Expressions.
The following guidelines apply when you enter numeric values in search conditions:
> 1.23456e-9
Note For details about entering currency values in SQL Server, see Query Designer Considerations for SQL Server Databases.
The format you use to enter dates depends on the database you are using and in what pane of the Query Designer you are entering the date. The Query Designer can work with the following date formats:
{ d '1990-12-31' }
{ ts '1990-12-31 00:00:00' }
In general, the ANSI standard date format is used with databases that represent dates using a true date data type. In contrast, the datetime format is used with databases that support a datetime data type.
The following table summarizes the date format that you can use in different panes of the Query Designer.
Pane | Date format |
---|---|
Grid | Locale-specific Database-specific ANSI standard Dates entered in the Grid pane are converted to a database-compatible format in the SQL pane. |
SQL | Database-specific ANSI standard Dates entered into the SQL pane are converted to the locale-specific format in the Grid pane. |
Results | Locale-specific |
The format of logical data varies from database to database. Very frequently, a value of False is stored as zero (0). A value of True is most frequently stored as 1 and occasionally as -1. The following guidelines apply when you enter logical values in search conditions:
SELECT * FROM authors
WHERE contract = 0
SELECT * FROM authors
WHERE contract = 1
SELECT * FROM authors
WHERE contract <> 0