笔记137 蜡人张reporting service6
笔记137 蜡人张reporting service6
1 --蜡人张reporting service6 2 SELECT 3 EmployeeID, 4 Title, 5 BirthDate, 6 VacationHours, 7 Gender, 8 MaritalStatus 9 FROM [AdventureWorks].[HumanResources].[Employee] 10 WHERE 11 --------------------------------------------------------------------------------- 12 (Title LIKE N'%' + CASE ISNULL(@Title, '') WHEN '' THEN '' ELSE @Title END + '%') 13 --------------------------------------------------------------------------------- 14 AND 15 --------------------------------------------------------------------------------- 16 (BirthDate > CASE ISDATE(@BirthDate) WHEN 0 THEN CONVERT(DATETIME, '1900-01-01 00:00:00', 102) ELSE @BirthDate END) 17 --------------------------------------------------------------------------------- 18 AND 19 --------------------------------------------------------------------------------- 20 (VacationHours = CASE ISNUMERIC(@VacationHours) WHEN 0 THEN VacationHours ELSE @VacationHours END )