Constant Values

<value> ::= <integer_constant>
<real_constant>
<string_constant>
<timestamp_constant>
<null_constant>
<integer_constant> ::= integer
0xhexadecimal
<real_constant> ::= integer_part.fractional_part
<string_constant> ::= 'string'
<timestamp_constant> ::= TIMESTAMP ( 'timestamp' , 'format' )
<null_constant> ::= NULL

Constants are immutable field-expressions, and they are mostly used in expressions or as arguments of functions.


Constants:

<integer_constant>

Constant values of the INTEGER type can be entered as decimal numbers, or as hexadecimal numbers preceded by the "0x" prefix.
For more information about the Log Parser INTEGER data type, see INTEGER Data Type.

<real_constant>

Constant values of the REAL type are entered as decimal numbers containing a decimal point.
For more information about the Log Parser REAL data type, see REAL Data Type.

<string_constant>

Constant values of the STRING type are entered as strings enclosed by single quote characters ( ' ).
The single quote character ( ' ) and the backslash character ( \ ) are considered special characters in a string constant, and they can only be entered as escape sequences preceded by a backslash character ( \' and \\ ), as in the following example:
'Contains \' single quote and \\ backslash'
In addition, any character (including illegal characters and non-printable characters) can be entered using the \uxxxx notation, where xxxx is the 4-digit hexadecimal representation of the desired UNICODE character, as in the following example:
'Contains\u0009tabs'
For more information about the Log Parser STRING data type, see STRING Data Type.

<timestamp_constant>

Constant values of the TIMESTAMP type are entered with the special TIMESTAMP keyword, followed by a string representation of the desired timestamp, and by the format of the string representation of the desired timestamp, using the Log Parser Timestamp Format Specifiers.
If the timestamp format specifiers include date specifiers only, the resulting TIMESTAMP value will be a date-only timestamp. Similarly, if the timestamp format specifiers include time of day specifiers only, the resulting TIMESTAMP value will be a time-only timestamp.
For more information about the Log Parser TIMESTAMP data type, see TIMESTAMP Data Type.

<null_constant>

Constant values of the NULL type are entered with the special NULL keyword.
For more information about the Log Parser NULL data type, see NULL Data Type.

Remarks:


Examples:

A. Integer constant entered as decimal number

sc-bytes >= 1000

B. Integer constant entered as hexadecimal number

BIT_AND( Flags, 0x1000 )

C. Real constant

AVG(time-taken) < 75.45 

D. String constant

'Some string'

E. String constant containing special characters

'Contains \' single quote and \\ backslash'

F. String constant containing UNICODE characters

'Contains a \u2530 UNICODE character'

G. Timestamp constant

TimeGenerated > TIMESTAMP( '2004-05-28 19:12:43', 'yyyy-MM-dd hh:mm:ss' )

H. Date-only timestamp constant

date > TIMESTAMP( '2004-05-28', 'yyyy-MM-dd' )

I. Time-only timestamp constant

time > TIMESTAMP( '19:12:43', 'hh:mm:ss' )

J. NULL constant

Message <> NULL

See also:

Field Expressions
INTEGER Data Type
REAL Data Type
STRING Data Type
TIMESTAMP Data Type
NULL Data Type

Basics of a Query

© 2004 Microsoft Corporation. All rights reserved.