Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

DateTimePicker in ReportViewer

Avatar of Jpcoder
Jpcoder asked on
Programming Languages-OtherVisual Basic Classic
6 Comments1 Solution1730 ViewsLast Modified:
I am trying to add the DateTimePicker to my report, the SQL query will run in the configuration wizard but not on the report.

Please help if you can.

Here is what I have:

I am using VB 2005 ReportViewer  
I have a dataset  tableadapter  that queries a SQL db
------------------------------------------
On my report page I have two DateTimePicker

DateTime1_Start
DateTime2_End
-------------------------------------------
My TableAdapter SQL Statement:

SELECT        AVG(Unit) AS AUnit, AVG(StandardUnits) AS SUnits, AVG(Case) AS ACase , Shift, LineNumber,

FROM            Line2Data

WHERE        (DateAndTime BETWEEN @DateAndTime1_Start AND @DateAndTime2_End)

---------------------------------------------
My Report VB code:

Private Sub DateAndTime1_Start_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateAndTime1_Start.ValueChanged
       
Me. Line2DataTableAdapter.Fill(Me.L2ReportDataset.Line2Data, DateAndTime1_Start.value, DateAndTime2_End.Value)

        Me.ReportViewer1.RefreshReport()
    End Sub

-----------------------------------------------
 
ASKER CERTIFIED SOLUTION
Avatar of leonstryker
leonstrykerFlag of United States of America imageVP

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answers