Microsoft SharePoint Team Blog
The official blog of the Microsoft SharePoint Product Group
SQL Expressions
Logical Comparisons
Introduction
For your databases, you can create expressions that represent a combination of values, variables, and operators. To support expressions, Transact-SQL provides operators other than, or in addition to, those we saw in Lesson 2.
A comparison is a Boolean operation that produces a true or a false result, depending on the values on which the comparison is performed. A comparison is performed between two values of the same type; for example, you can compare two numbers, two characters, or the names of two cities. To support comparisons, Transact-SQL provides all necessary operators.
Conditional Statements
Introduction
IF...ELSE
The IF condition we used above is appropriate when you only need to know if an expression is true. There is nothing to do in other alternatives. Consider the following code:
DECLARE @DateHired As DateTime,
@CurrentDate As DateTime
SET @DateHired = '1996/10/04'
SET @CurrentDate = '2007/04/16'
IF @DateHired > @CurrentDate
PRINT 'You have the experience required for a new promotion'
GO
source : http://blogs.msdn.com/sharepoint/default.aspx
Minggu, 15 Februari 2009
Langganan:
Postingan (Atom)