Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jonathanr
Starting Member
11 Posts |
Posted - 2008-03-26 : 23:42:34
|
Hi,Not sure if I will be able to get the answer I need on this forum but hopefully I will!We have a previous report that uses the code: AND T1."Decision_Date" BETWEEN '2005-07-01 00:00:00.000' AND '2006-06-30 00:00:00.000' AND T1."Decision_Type_Description"With this the report was run with the "static" dates, the new report (in MS reporting services) requires that the user be able to enter in the start date range and the end date range. I have come up with something like: (T1."Decision_Date" = @Start_Year) AND (T1."Decision_Date" = @End_Year)But not working. Can anyone assist?Thanks,jonathanr |
|
jonathanr
Starting Member
11 Posts |
Posted - 2008-03-27 : 01:12:17
|
OK, have the solution. SELECT T1.Class_Code, T1.Type_Code, T1.Description, T1.Formatted_Application_Number, T1.Decision_Type_Description, T2.Major_Description, T2.Minor_Description, T1.Decision_Date AS Expr1, T1.Decision_DateFROM Application_Facts T1 LEFT OUTER JOIN Application_Categories T2 ON T1.Application_Facts_Key = T2.Application_Facts_KeyWHERE (T1.Class_Code IN ('APP ')) AND (T1.Type_Code IN ('DA01A ', 'DA12 ', 'DA13 ', 'DA07 ', 'ODA ', 'PLD ', 'DA01 ', 'DA02 ', 'DA03 ', 'DA05 ', 'DA06 ', 'DA10 ', 'DA14 ', 'INT ')) AND (T1.Decision_Type_Description IN ('Approved by Accredited Certifier ', 'Approved ', 'Approved by the Land and Environment Court ', 'Approved under Delegated Authority ', 'Deferred Commencement Consent - Delegated ', 'Approved by Council ', 'Deferred Commencement ')) AND (T1.Decision_Date < @End_Year) AND (T1.Decision_Date > @Start_Year)ORDER BY T1.Decision_Date |
|
|
|
|
|
|
|