on 2020 Nov 03 6:37 AM
I use the following code to feed a record selection formula to a report. I'm using VB.Net and MS SQL Server. "exp_date" is a date type column (Ex: 2021-10-25). getServerDateTime() is my own function to get the server date. "Impersonate" loads the login details to the report. I get the attached error when I'm running this code. What am I doing wrong here?
Case "Expired Batches"
Dim crepExpIt As New crepExpiered
Dim curDate As Date = Format(getServerDateTime().Today)
CReportAuthentication.Impersonate(crepExpIt)
crepExpIt.RecordSelectionFormula = "{TB_STOCK.exp_date} <=#" & curdate & "#"
CrystalReportViewer1.ReportSource = crepExpIt
CrystalReportViewer1.Zoom(85)
CrystalReportViewer1.Refresh()
CrystalReportViewer1.RefreshReport()
Request clarification before answering.
I believe it needs single quotes as if it were a string instead of the #.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
30 | |
8 | |
8 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.