I want to get the data between today this the coding i used

  CrystalReportViewer1.SelectionFormula = "{sell.Date}= '" & DateTimePicker2.Value & "' BETWEEN {sell.Date}= '" & DateTimePicker1.Value & "'"

I saved the data into data

Dim date1 As Date = DateTimePicker1.Value.Date

THE ERROR I got have attached as a picture
I need help quickly as possible

Attachments eRROR.png 40.51 KB

Enclose date value within the pair of # (hash) if field type is Date type.

CrystalReportViewer1.SelectionFormula = "{sell.Date}>=#" & DateTimePicker2.Value & "#  and  {sell.Date}<=#" & DateTimePicker1.Value & "#"

The error I got have attached it,the tables structure also attached
In the date column the data is like this:9/26/2012 12:00:00 AM the time has alos recorded like this in every data.

Attachments 1.png 40.68 KB Capture.JPG 33.05 KB
    CrystalReportViewer1.SelectionFormula = "{sell.Date}>=#" & DateTimePicker2.Value & "# and {sell.Date}<=#" & DateTimePicker1.Value & "#"

avd I didn't get any errors but data is not displaying actualy it is not this coding

Edited 3 Years Ago by Dili1234

This question has already been answered. Start a new discussion instead.