Results 1 to 2 of 2

Thread: VB and crystal reports yearly reports shows different dates

  1. #1

    Thread Starter
    Registered User
    Join Date
    May 2022
    Posts
    1

    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()

  2. #2
    Hyperactive Member
    Join Date
    Jul 2007
    Posts
    476

    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
  •  



Click Here to Expand Forum to Full Width