?
Solved

Crystal Reports - Record Selection for Last YTD with TIME

Posted on 2013-11-22
5
Medium Priority
?
422 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 39670857
Try  this

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

mlmcc
0
 

Author Comment

by:Chopp
ID: 39670879
Hi mlmcc,

That idea returned zero records.

~Chopp
0
 
LVL 35

Accepted Solution

by:
James0628 earned 1000 total points
ID: 39671231
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 101

Assisted Solution

by:mlmcc
mlmcc earned 1000 total points
ID: 39671456
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
ID: 39671513
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

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