Click to See Complete Forum and Search --> : date problem


pasin
November 14th, 2008, 09:04 AM
I have created a parameter named datapare in cr of type date. When I try to pass the date from vb to cr happens a strange thing.

crystalReport1.ParameterFields(1) = "datapare; date(" & Format(DTPicker1.Year, "yyyy") & "," & Format(DTPicker1.Month, "mm") & "," & Format(DTPicker1.Day, "dd") & "); true" Format(DTPicker1.Month, "mm") & "," & Format(DTPicker1.Day, "dd") & "); true"
Debug.Print CrystalReport1.ParameterFields(1)

The output of the last line is:
datapare; date(1905,01,30); true
Even if I enter today's date

jggtz
November 14th, 2008, 03:14 PM
Debug your project
Insert a MsgBox DTPicker1.Value before assign to parameter
Maybe you're initializing the control, etc?

pasin
November 15th, 2008, 04:57 AM
I have already done that and debug.print dtpicker1.Year gives the right year and not 1905

pasin
November 17th, 2008, 06:48 AM
Now I understand that it is a problem of oracle because I am using oracle as database.
But I still can't find the solution.