• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 153
  • Last Modified:

Visual Basic coding for Crystal report


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
anuraja
Asked:
anuraja
1 Solution
 
anurajaAuthor Commented:

This website providing a good clarification
0
 
SethiCommented:
When you pass a data source to the report at runtime pass recordset with a SQL statement where date < 29/03/2003.
0
 
trkcorpCommented:
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
 
trkcorpCommented:
OOPS!
Above should read:
.SelectionFormula = "{dat.FDate} =  Date(" & Year(txtFrom) & "," & Month(txtFrom) & _
           "," & Day(txtFrom) & ")"
0
 
mlmccCommented:
For the RDC use

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

mlmcc
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now