Solved

crystal report filter

Posted on 2002-03-04
2
186 Views
Last Modified: 2008-03-06

Crystalreport1.selectionformula="{item.code} like 'El*'"

this code will make report all code with first 2 char EL my question is how to make 2 filter, code and date.

Thank You
0
Comment
Question by:ekohartono
2 Comments
 
LVL 4

Accepted Solution

by:
trkcorp earned 50 total points
ID: 6840325
Pass it as Date(YYYY,MM,DD)
Where txtFrom is a valid date
.SelectionFormula = "({Tbl.Date} >=  Date(" & Year(txtFrom) & "," & Month(txtFrom) & _
            "," & Day(txtFrom) & ") and {Tbl.Date} <= Date(" & Year(txtTo) & "," & Month(txtTo) & _
            "," & Day(txtTo) & "))"

OR:
Dim dFrDt as String
dFrDt = Format(CDate(txtChkDt), "\D\a\t\e\(yyyy\,mm\,dd)")
CrystalReport1.SelectionFormula = "{Tbl.Date} = " & dFrDt

In your case perhaps:
Dim dFrDt as String
Crystalreport1.selectionformula="{item.code} like 'El*' and {Tbl.Date} = " & Format(CDate(txtChkDt), "\D\a\t\e\(yyyy\,mm\,dd)")
0
 
LVL 1

Expert Comment

by:jmgs082598
ID: 6841665
I would build the filter as following:

Crystalreport1.selectionformula="{item.code} like 'El*' and {item.Date} = date(" & year(vardate) & "," & month(vardate) & "," & month(vardate) & ")"
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access 2016 VB code 9 115
How to create a duplicate finder Application 9 121
Saving history changes to sub form 4 43
How to compare ms sql hashbytes results within vb6 5 75
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question