Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Passing date option parameter in command object Post Reply Post New Topic
Author Message
vtcollins
Newbie
Newbie
Avatar

Joined: 08 May 2009
Location: United States
Online Status: Offline
Posts: 1
Quote vtcollins Replybullet Topic: Passing date option parameter in command object
    Posted: 08 May 2009 at 8:47am
I am converting a Crystal 10 report to Crystal 2008. The report uses a command object. THe report has a paramter that allows the user to select for example last full month. In 2008 I am getting a error message that I have a data type mismatch between the then/else statement. Can someone help with this issue?
This is the code I am using.
 
CASE
  WHEN '{?Date Range Option}'= 'Last Full Week'  
   THEN (cal.calendar_date - cal.day_of_week- 6)
  WHEN '{?Date Range Option}'= 'Last Full Month'  
   THEN ADD_MONTHS((cal.calendar_date - cal.day_of_month)+1,-1)
  WHEN '{?Date Range Option}'= 'Custom Date Range'
   THEN {?Start DATE}
  ELSE cal.calendar_date
 END  AS startDate,
 CASE 
  WHEN '{?Date Range Option}'= 'Last Full Week'  
   THEN  (cal.calendar_date - cal.day_of_week)
  WHEN '{?Date Range Option}'= 'Last Full Month'  
   THEN  (cal.calendar_date - cal.day_of_month)
  WHEN '{?Date Range Option}'= 'Custom Date Range'
   THEN {?End DATE}
  ELSE cal.calendar_date
 END AS endDate,
HCConsultant
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 11 May 2009 at 6:52am
I would try commenting out when/then combinations.  they all need to return the same datatype, which would appear to be a datetime.
 
The other would be take expression and run it in sql and see if it give you a better description of the error, if any.
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.