Creating a selection formula based on a DateTime feild from crystal report

  • Thread starter Thread starter Reny J Joseph Thuthikattu
  • Start date Start date
R

Reny J Joseph Thuthikattu

Hi,
I want to create a a crystal report based on the DAteTime Range.Can any one
tell me how do i pass the Values from the VB.NET.I am uasing
Crystalreportviewer control
My field is isin the format 2/12/2000 2:04:00 PM
Please help me out
Reny
 
Hi Reny,

Here's an example of setting the date and other info in a string and passing
it to the viewer control:
Dim mglobals As New globals

mglobals.gl_selectionstring = "{bnlsum.inv_dt} >= #" & datevars & "#" & "
and {bnlsum.inv_dt} <= #" & datevare & "#"

Datevars is the start date of a date range; datevare is the end of the date
range (eg, 5/18/03 - 2/11/04).

Also, note that I am using the column names as you would inside crystal (eg,
{bnlsum.inv_dt}), so the viewer properly recognizes the string.

Also, when the report is called, add this:

CrystalReportViewer1.SelectionFormula = mglobals.gl_selectionstring

In this example, globals is simply a module which contains numerous global
variables that I use from time to time.

HTH,

Bernie Yaeger
 
Back
Top