Home
Crystal Reports Training
Crystal Reports XI
Crystal Reports .NET
Crystal Reports Forum
News
Tech Support
Active Topics
Memberlist
Search
Help
Register
Login
Technical Questions
Crystal Reports Forum
:
Crystal Reports 9 through 2022
:
Technical Questions
Topic: command table?
Oldest Post First
Newest Post First
Author
Message
cbaldwin
Groupie
Joined: 09 Apr 2014
Online Status: Offline
Posts: 81
Topic: command table?
Posted: 07 Mar 2019 at 4:36am
I am using the following Case statement in my Command Table SQL (oracle) script.
CASE
WHEN
bl.bag_type_cd IN ('DOUBLE CPD','TRIPLE CPD') THEN MOD(biad.reference_value,10)
WHEN
bl.bag_type_cd IN ('ALYX RBC','PLAS PHER') THEN MOD(biad.reference_value,6)
WHEN
bl.bag_type_cd = 'PLT PHER' THEN MOD(biad.reference_value,3)
ELSE 99
END AS remainder
I would like to be able to use the"remainder" field in my WHERE statement and say
WHERE
remainder<>0
Does anyone have any suggestions? If there is a better forum for this question please let me know.
CJB
IP Logged
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Posted: 07 Mar 2019 at 6:10am
This is actually a SQL question rather than a Crystal question.
There are a couple of ways to go about this.
1. Put the entire case statement in the Where clause instead of referencing the field.
2. Leave the condition out of the where clause of your current query. Then set up an outer select statement that looks something like this:
Select *
from (
current query
) as data
where data.remainder <> 0
-Dell
Proviti, Data & Analytics Practice
www.protiviti.com/US-en/data-management-advanced-analytics
IP Logged
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Posted: 07 Mar 2019 at 6:12am
You might also want to look at this blog post for more information about using commands:
https://blogs.sap.com/2015/04/01/best-practices-when-using-commands-with-crystal-reports/
-Dell
Proviti, Data & Analytics Practice
www.protiviti.com/US-en/data-management-advanced-analytics
IP Logged
cbaldwin
Groupie
Joined: 09 Apr 2014
Online Status: Offline
Posts: 81
Posted: 07 Mar 2019 at 6:16am
Thanks for the input. I will try option 2.
IP Logged
Printable version
Forum Jump
-- Select Forum --
Announcements
Talk with the Author
Self-Publishing
Job Postings
New feature request
Report Design
Data Connectivity
Technical Questions
Tips and Tricks
Crystal Xcelsius
Report Design
Data Connectivity
Writing Code
Tips and Tricks
Report Design
Data Connectivity
Writing Code
Tips and Tricks
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.
HOME
|
FREE EBOOK
|
PROGRAMMING GUIDE
|
PURCHASE
|
REVIEWS
|
CONTACT ME
|
FAQ
|
LINKS
|
CLICK PLAYS
|
COACH FORUMS
|
TROPICAL FISH
© 2004-2024 Brian Bischof. All Rights Reserved.