Solved

Crystal Reports - Record Selection for Last YTD with TIME

Posted on 2013-11-22
5
417 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
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 34

Accepted Solution

by:
James0628 earned 250 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 100

Assisted Solution

by:mlmcc
mlmcc earned 250 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

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. …
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 …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

773 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