Jump to content
  • 0

Case Select Statement Issues


Vad21

Question

So I have used Case Select statements for some time and never ran into the roadblock I have today. Not quite sure if it is a caspio limitation or issue or if I am just snow-blind to the situation and can not see my mistake.

The code below I have placed in a calculated field on my report and it works fine until I put the DateDiff statement at the end. The same Datediff worked fine independently but not in this case statement. Any help would be soooo appreciated. TY:)

 

CASE

WHEN [@field:Estimate_Sent_To_FS_Date] IS NOT NULL
THEN "Complete"

WHEN [@field:Canceled_Date] IS NOT NULL THEN "Canceled"

ELSE Datediff(day,[@field:Eval_Fax_in_Date],GetDate())
 
END

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
3 hours ago, Vad21 said:

So I have used Case Select statements for some time and never ran into the roadblock I have today. Not quite sure if it is a caspio limitation or issue or if I am just snow-blind to the situation and can not see my mistake.

The code below I have placed in a calculated field on my report and it works fine until I put the DateDiff statement at the end. The same Datediff worked fine independently but not in this case statement. Any help would be soooo appreciated. TY:)

 

CASE

WHEN [@field:Estimate_Sent_To_FS_Date] IS NOT NULL
THEN "Complete"

WHEN [@field:Canceled_Date] IS NOT NULL THEN "Canceled"

ELSE Datediff(day,[@field:Eval_Fax_in_Date],GetDate())
 
END

Probably because your THEN is a string, and your ELSE is a 'number' Try to convert it to text CONVERT(VARCHAR, (Datediff(day,[@field:Eval_Fax_in_Date],GetDate())))

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...