?
Solved

Visual Basic coding for Crystal report

Posted on 2003-03-13
5
Medium Priority
?
152 Views
Last Modified: 2013-11-25

Dear Sir,

 I am now working with one Visual Basic Project. In that I have to filter
the records using the date field. If I am use it in directly it can filter the required data. But I how can I filter from the coding. I am using this
ie. Crystalreport1.Selection formula = "{dat.fdate} < '29/03/2003'"

But it can not filter it. Is there any coding technique available

Please send me the above information to my id navadhak@yahoo.com

Thank you

Regards, Raja

0
Comment
Question by:anuraja
[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
5 Comments
 

Author Comment

by:anuraja
ID: 8126474

This website providing a good clarification
0
 
LVL 18

Expert Comment

by:Sethi
ID: 8126907
When you pass a data source to the report at runtime pass recordset with a SQL statement where date < 29/03/2003.
0
 
LVL 4

Accepted Solution

by:
trkcorp earned 420 total points
ID: 8128825
Use the crystal Date() function (Syntax = Date(yyyy,mm,dd)), for examples:

.SelectionFormula = "{dat.FDate} =  Date(" & Year(txtFrom) & "," & Month(txtFrom) & _
            "," & Day(txtFrom)

OR

dim sFrdt as string
sFrdt = Format(CDate(Text1(0)), "\D\a\t\e\(yyyy\,mm\,dd)")
.SelectionFormula = "{dat.FDate} = " & frdt
0
 
LVL 4

Expert Comment

by:trkcorp
ID: 8128835
OOPS!
Above should read:
.SelectionFormula = "{dat.FDate} =  Date(" & Year(txtFrom) & "," & Month(txtFrom) & _
           "," & Day(txtFrom) & ")"
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 8130162
For the RDC use

.RecordSelectionFormula = "{dat.FDate} =  Date(" & Year(txtFrom) & "," & Month(txtFrom) & _
           "," & Day(txtFrom)

mlmcc
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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.
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…
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…

800 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