Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

crystal report filter

Posted on 2002-03-04
2
Medium Priority
?
193 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 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

876 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