ASKER
ASKER
Your statement builds this:
SELECT * FROM [TICKET_VIEW] WHERE ([CLIENT_ID] = 1) AND dt_created >= convert(datetime, '1/' + cast(1 as varchar(2) + '/' + cast(2005 as char(4), 101) and dt_created < dateadd(m, 1,convert(datetime, '1/' + cast(1 as varchar(2) + '/' + cast(2007 as char(4), 101)) ORDER BY DT_CREATED DESC
You're missing single quotes around the numbers and closing parentheses around the cast statements. Here it is fixed:
SELECT * FROM [TICKET_VIEW]
WHERE ([CLIENT_ID] = 1) AND
dt_created >= convert(datetime, '1/' + cast('1' as varchar(2)) + '/' + cast('2005' as char(4)), 101) and
dt_created < dateadd(m, 1,convert(datetime, '1/' + cast('1' as varchar(2)) + '/' + cast('2007' as char(4)), 101))
ORDER BY DT_CREATED DESC
Also from your statements above it sounds like the values of your drop down lists are actually Feb,Mar, Apr etc..those should be set to numbers if you don't have it that way, here is my drop down list(s).
<asp:DropDownList ID="ddlMonth" runat="server">
<asp:ListItem Value="1">Jan</asp:ListItem>
<asp:ListItem Value="2">Feb</asp:ListItem>
<asp:ListItem Value="3">Mar</asp:ListItem>
<asp:ListItem Value="4">Apr</asp:ListItem>
<asp:ListItem Value="5">May</asp:ListItem>
<asp:ListItem Value="6">Jun</asp:ListItem>
<asp:ListItem Value="7">Jul</asp:ListItem>
<asp:ListItem Value="8">Aug</asp:ListItem>
<asp:ListItem Value="9">Sep</asp:ListItem>
<asp:ListItem Value="10">Oct</asp:ListItem>
<asp:ListItem Value="11">Nov</asp:ListItem>
<asp:ListItem Value="12">Dec</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="ddlYear" runat="server">
<asp:ListItem>2005</asp:ListItem>
<asp:ListItem>2006</asp:ListItem>
<asp:ListItem>2007</asp:ListItem>
<asp:ListItem>2008</asp:ListItem>
<asp:ListItem>2009</asp:ListItem>
</asp:DropDownList>
ASKER
Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.
TRUSTED BY
ASKER