SQL CASE Statement

Discuss how to create custom stats, reports and HUD profiles and share your creations.

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

Re: SQL CASE Statement

Postby wallacedavidl » Tue Dec 17, 2024 7:46 pm

Hey, Team -

I'm not using SUM. Following is a sample custom statistic CASE statement converted from an IF statement:

CASE
WHEN (my_vpip > .00 AND my_vpip < .11)
AND
(my_pfr >= (my_vpip - my_pfr))
THEN format('NIT')
ELSE format('-')
END

In an IF statment construct, the format fuction works OK, but within a case statement an Error returns for an Invalid Value Statement.
Thanks,
David
wallacedavidl
 
Posts: 91
Joined: Sat Aug 03, 2024 4:37 pm

Re: SQL CASE Statement

Postby Flag_Hippo » Thu Dec 19, 2024 1:54 pm

As far as I am aware you cannot use CASE directly in statistics like that so you will need to use an IF statement.
Flag_Hippo
Moderator
 
Posts: 17075
Joined: Tue Jan 31, 2012 7:50 am

Re: SQL CASE Statement

Postby wallacedavidl » Wed Dec 25, 2024 9:35 pm

Ok, thanks. Happy holidays.
wallacedavidl
 
Posts: 91
Joined: Sat Aug 03, 2024 4:37 pm

Previous

Return to Custom Stats, Reports and HUD Profiles

Who is online

Users browsing this forum: No registered users and 16 guests