Solved

crystal report filter

Posted on 2002-03-04
2
185 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now