Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Max Effective Date Based On Year Post Reply Post New Topic
Author Message
John2Chr
Newbie
Newbie
Avatar

Joined: 11 Apr 2012
Online Status: Offline
Posts: 10
Quote John2Chr Replybullet Topic: Max Effective Date Based On Year
     Posted: 20 Mar 2013 at 3:30am
This is in the SQL Expression editor Crystal 8.5.

Works for grabbing everything with a max effect date of as of now. Is there a way to write this based on fiscal year like listed below? I think I will have a parameter field that feeds it like {fiscal Year}


If Fiscal Year is 2012, then max effective date <7/1/2013
If Fiscal Year is 2013, then max effective date <7/1/2014
If Fiscal Year is 2014, then max effective date <7/1/2015
If Fiscal Year is 2015, then max effective date <7/1/2016

(SELECT MAX(PS_X_S_M_CFATTRIB2.EFFDT)
FROM SYSADM.PS_X_S_M_CFATTRIB PS_X_S_M_CFATTRIB2
WHERE PS_X_S_M_CFATTRIB2.CHARTFIELD_VALUE = PS_X_S_M_CFATTRIB.CHARTFIELD_VALUE and
PS_X_S_M_CFATTRIB2.W_CF_ATTRIBUTE = PS_X_S_M_CFATTRIB.W_CF_ATTRIBUTE and ((PS_X_S_M_CFATTRIB2.W_CF_ATTRIBUTE not in ('BUD_PROG','BUD_ACT') or
PS_X_S_M_CFATTRIB2.EFFDT < {fn NOW()})) )
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum