-
May 18th, 2022, 05:16 AM
#1
Thread Starter
Registered User
VB and crystal reports yearly reports shows different dates
i would like to ask how we can fix our project in vb we are currently on the yearly and monthly reports generation but when we choose a date outside the year 2022 it still shows the 2022 data for that month. here is our code that we use
Dim cr1 As New CrystalReport1 Dim da As New SqlDataAdapter("select Date, Customer_No, Table_No, Order_ID, Total_Amount from SalesTable5 where Date between '" & DateTimePicker1.Text & "' and '" & DateTimePicker2.Text & "' order by Date desc", con) Dim dt As New DataTable da.Fill(dt) cr1.SetDataSource(dt) CrystalReportViewer1.ReportSource = cr1 CrystalReportViewer1.RefreshReport()
-
May 20th, 2022, 07:17 PM
#2
Hyperactive Member
Re: VB and crystal reports yearly reports shows different dates
I'm not an SQL Server expert but some DBMS use Date as a reserved word that will return the system date in some or all cases. You may have to enclose the field name Date as [Date].
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|