Solved

crystal report filter

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

708 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

15 Experts available now in Live!

Get 1:1 Help Now