|
-
Sep 15th, 2000, 02:20 PM
#1
How do I construct a SelectionFormula that uses a date in VB? I am using SQL Server 6.5.
My VB6 code looks like this:
Private Sub cmdPrint_Click()
Dim rptSql As String
Dim rptDate As Date
rptSql = "SELECT * FROM CheckRegister WHERE {CheckRegister.bank_statement_date}=Date('"
rptSql = rptSql & cboStatementDate.Text + "')"
CrystalReport1.SelectionFormula = rptSql
CrystalReport1.Action = 1
End Sub
I have tried many variations on this formula, such as using the string variable alone, in quotes, and using a date variable instead of a string variable, but nothing seems to work. I keep getting the error message "The remaining text does not appear to be part of the formula".
Does the date have to converted to a different format?
If any one has a solution, I would greatly appreciate it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|