Help: Crystal Report Selection Formula

Help: Crystal Report Selection Formula

Post by Joey Kruge » Fri, 16 Jan 1998 04:00:00



I'm using Crystal Reports 3.  I need to print a report displaying only the
record that were added after a certain date *and* time.
For example, I might need all the record added after 3:00pm 5 January 1998.
This requires me to set the SelectionFormula property on the Crystal
Control.

Crystal gives you the - Date(yyyy,mm,dd) - function but I need to specify a
time as well.

Does anyone know of a way to do this???
If not do the more recent versions of Crystal reports offer a TIME
function???

Thanks
Joey Kruger

Remove NOSPAM from address when E-mailing

 
 
 

Help: Crystal Report Selection Formula

Post by Bob » Sun, 18 Jan 1998 04:00:00


What I do in these situations is to create a similar condition using the
Record Selection Expert (is this in v3?) then go to the raw record selection
text and see how Crystal implemented it.

--


>I'm using Crystal Reports 3.  I need to print a report displaying only the
>record that were added after a certain date *and* time.
>For example, I might need all the record added after 3:00pm 5 January 1998.
>This requires me to set the SelectionFormula property on the Crystal
>Control.

>Crystal gives you the - Date(yyyy,mm,dd) - function but I need to specify a
>time as well.

>Does anyone know of a way to do this???
>If not do the more recent versions of Crystal reports offer a TIME
>function???


 
 
 

Help: Crystal Report Selection Formula

Post by Olli-Pekka Isol » Fri, 23 Jan 1998 04:00:00


I have used these methods with CRW5:

   ' for date field...
   rptReport.SelectionFormula = "{fldField} = Date(1998,1,1)"

   ' for time field... (Not tested)
   rptReport.SelectionFormula = "{fldField} = Time(10, 30, 0)"

   ' for datetime field...
   rptReport.SelectionFormula = "Date (DTSToDateTime ({fldField})) =
Date(1998, 1, 1)"

   ' for datetime field...
   rptReport.SelectionFormula = "Time (DTSToDateTime ({fldField})) =
Time(10, 30, 0)"

   ' for datetime field... (Not tested)
   rptReport.SelectionFormula = "{fldField} = DateTime(1998, 1, 1, 10, 30,
0)"

You have to distribute CRW files ufl*.dll with your application. You'd
better to uncheck followin g setting from options window: 'Convert
Date/Time field to Date'.

This solution has one drawback: It causes CRW fetch ALL the record in the
table and THEN selecting appropriate rows. This may cause long delays and
memory shortage especially with large MS SQL Server 6.5 tables. Seagate
Software has noted this behavior true.



Quote:> I'm using Crystal Reports 3.  I need to print a report displaying only
the
> record that were added after a certain date *and* time.
> For example, I might need all the record added after 3:00pm 5 January
1998.
> This requires me to set the SelectionFormula property on the Crystal
> Control.

 
 
 

1. Help with using date variable in Crystal reports selection formula

Can anybody help me with using a date variable in a crystal reports
selection formula. I have tried the code following, as well as enclosing in
# signs, and anything else you can think of but nothing seems to work.
Please help.

CrystalReport1.SelectionFormula = "{Customers.DateOfShow} = '" & txtDate &
"'"

Thank you

Brant.

2. Expanding CMD info from sp_who

3. HELP with selection formula in VB6 for Crystal Reports

4. Oracle8-Linux/Empty shared lib files ???

5. Crystal Report V4.6 Selection Formula

6. Ado with VB Script

7. Crystal Reports Selection Formula

8. I $400 TODAY AND IT IS ONLY 3PM

9. Selection Formula - Crystal repors

10. HELP: Crystal Reports - recursive formulas/functions?

11. Crystal Report Formula Help

12. Crystal Reports - Displaying selection data in report

13. Using formula field in selection formula