Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 158
  • Last Modified:

Crystal Reports - How to query a certain record to print?

How can I select a certain record from a table with Crystal Reports using VB Code.
0
Gmoney
Asked:
Gmoney
  • 3
  • 2
1 Solution
 
trkcorpCommented:
try something like this:
Crystalreport1.SelectionFormula = "({table.DateIssued} >=  Date(" & Year(txtFrom) & "," & Month(txtFrom) & _
            "," & Day(txtFrom) & ") and {table.DateIssued} <= Date(" & Year(txtTo) & "," & Month(txtTo) & _
            "," & Day(txtTo) & "))"
OR THIS:
.SelectionFormula = "{Table.Field} = " & NumericData
OR THIS:
.SelectionFormula ={Table.Field} = '" & AlpaNumericString & "'"
0
 
trkcorpCommented:
Sorry for the wierd continuations... you just never know what a thing will look like when you cut & paste.
0
 
GmoneyAuthor Commented:
thanks trkcorp, it worked
0
 
GmoneyAuthor Commented:
Hey trkcorp how would I retrieved the following data

Table = Continuation_Report
Field = Case_Number
Desired record = 123456
0
 
trkcorpCommented:
.SelectionFormula = "{Continuation_Report.Case_Number} = " & 123456
- OR -
Dim lNum as Long
lNum = 123456
.SelectionFormula = "{Continuation_Report.Case_Number} = " & lNum
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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