Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gridview to populate off of calendar.selecteddate

Status
Not open for further replies.

dstrange

Programmer
Nov 15, 2006
87
CA
Hi,

I'm trying to bind a calendar control's selected date to populate a gridview. I'm wondering if it has to do with date formatting?

Code:
SelectCommand="SELECT * FROM [tblTest] WHERE ([ReportDate] = @ReportDate) ORDER BY [ReportDate]" 

<SelectParameters>
<asp:ControlParameter ControlID="Calendar1"    Name="ReportDate" 
PropertyName="SelectedDate" Type="DateTime" />
            </SelectParameters>
 
Spoke too soon.

I updated my where clause.
Code:
SelectCommand="SELECT * FROM [tblTest] WHERE(CONVERT(VARCHAR(10),reportDate,101)
= @ReportDate) ORDER BY [ReportDate]"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top