Print Page | Close Window

Date Parameter minus 1 year to get data

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=16409
Printed Date: 05 May 2024 at 6:28am


Topic: Date Parameter minus 1 year to get data
Posted By: chudok
Subject: Date Parameter minus 1 year to get data
Date Posted: 10 May 2012 at 7:26am
I am using this formula below and it is not grabbing prior year MTD data.  what am I doing wrong?  I use the same basic formula to get this year MTD and it works.



if month({?Date})=month({SO_SalesOrderHistoryHeader.OrderDate}) and year({?Date})-1 = (year({SO_SalesOrderHistoryHeader.OrderDate})) then
{SO_SalesOrderHistoryHeader.TaxableAmt}+{SO_SalesOrderHistoryHeader.NonTaxableAmt} else 0



Replies:
Posted By: DBlank
Date Posted: 10 May 2012 at 8:23am
looks correct.
if either field would be NULL then you will get no return unless you set the formula to use defualt values for null


Posted By: DBlank
Date Posted: 10 May 2012 at 8:24am
also you are not limiting the data set in the select expert to exlude the data, correct?



Print Page | Close Window