[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
Solved

Crystal Reports - Record Selection for Last YTD with TIME

Posted on 2013-11-22
Medium Priority
424 Views
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
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
• 2
• 2

LVL 101

Expert Comment

ID: 39670857
Try  this

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

mlmcc
0

Author Comment

ID: 39670879
Hi mlmcc,

That idea returned zero records.

~Chopp
0

LVL 35

Accepted Solution

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

mlmcc earned 1000 total points
ID: 39671456
My formula should have been

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

mlmcc
0

Author Closing Comment

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

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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 …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…