Print Page | Close Window

how to filter time in a report

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=20406
Printed Date: 07 May 2024 at 12:33am


Topic: how to filter time in a report
Posted By: NewCRuser
Subject: how to filter time in a report
Date Posted: 28 Jan 2014 at 2:45pm
Hi guys,

I am creating a report that will show all the details based on a specific problem and specific time.

Example:
all related problems regarding "Printer". with a time frame of 0700H to 0100H Every week / month.

if I have the following data

Subject        Reported_Time
Printer...     1/1/2014 7:00AM
Printer...     1/1/2014 7:52AM
Printer...     1/2/2014 2:00AM

is it possible to display only the the first 2 rows?

Thanks in advance.



Replies:
Posted By: lolly54
Date Posted: 28 Jan 2014 at 9:47pm
You can use the Time function.

In the record selection section, use the following codes
{Subject} = "Printer" and
Time({Reported_Time}) in Time("07:00:00") to Time("01:00:00")


As I am not sure how your Subject data is like, here's other suggestion...
{Subject} startswith "Printer"
or
{Subject} like "*Printer*"

That should filter the records for you.



Posted By: NewCRuser
Date Posted: 28 Jan 2014 at 10:43pm
Thanks lolly54 for the reply. It works. I just added OR operator.
What I did is this. I created a formula -
if time({Command.CreationTime}) in time("07:00AM") to time ("11:59PM") or
time({Command.CreationTime}) in time("12:00AM") to time ("1:00PM") then
true
else false.

Is it okay if you could also answer my other thread regarding "Minimum and maximum value?" Thanks again.



Print Page | Close Window