I have an asp.net page that is successfully displaying Crystal Reports. However when it comes to exporting one particular report i get the following error:
Server Error in '/QuizReports' Application.
Error in File C:\DOCUME~1\NW2759\ASPNET~1.NW2\LOCALS~1\Temp\tempce1d7a87-b23d-4650-8dfd-309ce3e558dc.rpt: Error in formula <RecordSelection>. '{Emp.DStamp} = in Date 2004, 00, 00, 00)01, 00, 00, 00)27, 00, 00, 00) to Date (2004, 00, 00, 00)01, 00, 00, 00)28, 00, 00, 00)' A number, currency amount, boolean, date, time, date-time, or string is expected here.
the code that generates this error is as follows:
myDateReport.RecordSelectionFormula = "{Emp.DStamp} = in Date " & Mid(Me.lstStart.SelectedItem.Text, 7, 4) & ", 00, 00, 00)" & Mid(Me.lstStart.SelectedItem.Text, 4, 2) & ", 00, 00, 00)" & Mid(Me.lstStart.SelectedItem.Text, 1, 2) & ", 00, 00, 00)" & " to Date (" & Mid(Me.lstEnd.SelectedItem.Text, 7, 4) & ", 00, 00, 00)" & Mid(Me.lstEnd.SelectedItem.Text, 4, 2) & ", 00, 00, 00)" & Mid(Me.lstEnd.SelectedItem.Text, 1, 2) & ", 00, 00, 00)"
sql server uses a datetime format which is passed to crystal reports where i formatted it to display date only. On passing back through to asp.net it reverts to datetime although the time section now only displays 00:00:00.
Any help would be very much appreciated. Thanx.
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).