Print Page | Close Window

Date Range

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22937
Printed Date: 28 Apr 2024 at 10:56pm


Topic: Date Range
Posted By: bjfils
Subject: Date Range
Date Posted: 12 May 2021 at 4:43am
I have a report that runs once a month using the LastFullMonth parameter. I've been asked to run this report for a number of years, but can't figure out how to create a formula for essentially from 01/01/2018 through 04/30/2021. It's probably a simple thing that I'm overthinking.

I freely admit I'm self taught on only the basics of CR. Thanks!



Replies:
Posted By: bjfils
Date Posted: 12 May 2021 at 7:46am
I kept digging and found a formula that works:

{ticket.dateshipped} >=date(2018,01,01) and
{ticket.dateshipped} <=date(2021,04,30)

I was trying to have them be one line and use "between" or something like that.

I first entered the date as 01/01/2018 and it returned all dates, including those before 01/01/2018. Changing the formatting to 2018,01,01 fixed that.


Posted By: kevlray
Date Posted: 13 May 2021 at 4:39am
Also you can do something like this:

{ticket.dateshipped}in date(2018,01,01) to date(2021,04,03).  But in the end, the sql probably will evaluate to the same code.


Posted By: bjfils
Date Posted: 13 May 2021 at 5:39am
Thanks for another option!



Print Page | Close Window