Solved

crystal report filter

Posted on 2002-03-04
2
191 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

631 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