Solved

Crystal Reports - Record Selection for Last YTD with TIME

Posted on 2013-11-22
5
419 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 35

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…

726 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