Solved

Crystal Reports - Record Selection for Last YTD with TIME

Posted on 2013-11-22
5
414 Views
Last Modified: 2013-11-23
Hello Experts,

Can you show me how to include the TIME in a the record selection where I want to include records: {IIncident.I_tTimeTransmit} in LastYearYTD  using the CurrentDateTime to identify the TIME part ?

Thank you.
~Chopp
0
Comment
Question by:Chopp
  • 2
  • 2
5 Comments
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
Try  this

{IIncident.I_tTimeTransmit} >= Date(Year(CurrentDate),1,1)
AND
{IIncident.I_tTimeTransmit} <= DateAdd('yyyy',-1,CurrentDateTime)

mlmcc
0
 

Author Comment

by:Chopp
Comment Utility
Hi mlmcc,

That idea returned zero records.

~Chopp
0
 
LVL 34

Accepted Solution

by:
James0628 earned 250 total points
Comment Utility
LastYearYTD gives you a range of dates.  I assume that you only want to add the time to the ending date?

 This should work:

{IIncident.I_tTimeTransmit} in Minimum (LastYearYTD) to
 DateTime (Maximum (LastYearYTD), CurrentTime)

 There are other ways that you could handle it, including a formula like the one that mlmcc posted.  I just decided to use the LastYearYTD function that you were already using.


 FWIW, I think the problem with mlmcc's formula is that he didn't subtract 1 from the starting year.  If I'm right, his formula should work if you change the first line to:

{IIncident.I_tTimeTransmit} >= Date(Year(CurrentDate) - 1,1,1)


 James
0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 250 total points
Comment Utility
My formula should have been

{IIncident.I_tTimeTransmit} >= Date(Year(CurrentDate) - 1,1,1)
AND
{IIncident.I_tTimeTransmit} <= DateAdd('yyyy',-1,CurrentDateTime)

Open in new window


mlmcc
0
 

Author Closing Comment

by:Chopp
Comment Utility
mlmcc and James, Thank you so much!  Both of your ideas work perfectly for my report.
mlmcc, can you explain the pieces of your method so I can understand it better ?

Have a splendid day.
~Chopp
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now