Convert Crystal “if Previous” to SQLHow can I prevent SQL injection in PHP?Add a column with a default value to an existing table in SQL ServerInserting multiple rows in a single SQL query?Crystal report sql expression fieldHow do I UPDATE from a SELECT in SQL Server?Finding duplicate values in a SQL tableWhat are the pros and cons of performing calculations in sql vs. in your applicationHow to import an SQL file using the command line in MySQL?Convert INT to VARCHAR SQLCrystal Reports sql statement greyed out not working
What is this rubber on gear cables
Why use a retrograde orbit?
refer string as a field API name
AD: OU for system administrator accounts
Capital gains on stocks sold to take initial investment off the table
How could it be that 80% of townspeople were farmers during the Edo period in Japan?
How come Arya Stark didn't burn in Game of Thrones Season 8 Episode 5
Square spiral in Mathematica
Roman Numerals Equation 2
Why are there five extra turns in tournament Magic?
I recently started my machine learning PhD and I have absolutely no idea what I'm doing
Is it standard to have the first week's pay indefinitely withheld?
Would a "ring language" be possible?
Resistor Selection to retain same brightness in LED PWM circuit
How was the blinking terminal cursor invented?
SHAKE-128/256 or SHA3-256/512
A latin word for "area of interest"
Why is the A380’s with-reversers stopping distance the same as its no-reversers stopping distance?
How can we delete item permanently without storing in Recycle Bin?
Canadian citizen who is presently in litigation with a US-based company
Why doesn't Iron Man's action affect this person in Endgame?
How do Ctrl+C and Ctrl+V work?
Failing students when it might cause them economic ruin
Why aren't satellites disintegrated even though they orbit earth within their Roche Limits?
Convert Crystal “if Previous” to SQL
How can I prevent SQL injection in PHP?Add a column with a default value to an existing table in SQL ServerInserting multiple rows in a single SQL query?Crystal report sql expression fieldHow do I UPDATE from a SELECT in SQL Server?Finding duplicate values in a SQL tableWhat are the pros and cons of performing calculations in sql vs. in your applicationHow to import an SQL file using the command line in MySQL?Convert INT to VARCHAR SQLCrystal Reports sql statement greyed out not working
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am in process of converting all calculations in a Crystal report to SQL. One of the calculations is to identify when a service is a group. I want to add [GroupHours] to the SQL. So, the SQL is:
SELECT ServiceID, ServiceDate, Hours, IsGroup
FROM vSALS
The Crystal:
if (vSALS.IsGroup = 'Yes') // and Previous (vSALS.Hours) = vSALS.Hours
then vSALS.Hours * 2
else //vSALS.Hours 0
Can anyone help me translate the Crystal into a [GroupHours]
field in my query?
sql crystal-reports
add a comment |
I am in process of converting all calculations in a Crystal report to SQL. One of the calculations is to identify when a service is a group. I want to add [GroupHours] to the SQL. So, the SQL is:
SELECT ServiceID, ServiceDate, Hours, IsGroup
FROM vSALS
The Crystal:
if (vSALS.IsGroup = 'Yes') // and Previous (vSALS.Hours) = vSALS.Hours
then vSALS.Hours * 2
else //vSALS.Hours 0
Can anyone help me translate the Crystal into a [GroupHours]
field in my query?
sql crystal-reports
add a comment |
I am in process of converting all calculations in a Crystal report to SQL. One of the calculations is to identify when a service is a group. I want to add [GroupHours] to the SQL. So, the SQL is:
SELECT ServiceID, ServiceDate, Hours, IsGroup
FROM vSALS
The Crystal:
if (vSALS.IsGroup = 'Yes') // and Previous (vSALS.Hours) = vSALS.Hours
then vSALS.Hours * 2
else //vSALS.Hours 0
Can anyone help me translate the Crystal into a [GroupHours]
field in my query?
sql crystal-reports
I am in process of converting all calculations in a Crystal report to SQL. One of the calculations is to identify when a service is a group. I want to add [GroupHours] to the SQL. So, the SQL is:
SELECT ServiceID, ServiceDate, Hours, IsGroup
FROM vSALS
The Crystal:
if (vSALS.IsGroup = 'Yes') // and Previous (vSALS.Hours) = vSALS.Hours
then vSALS.Hours * 2
else //vSALS.Hours 0
Can anyone help me translate the Crystal into a [GroupHours]
field in my query?
sql crystal-reports
sql crystal-reports
edited Mar 23 at 16:15
Kounslr
asked Mar 23 at 16:09
KounslrKounslr
33
33
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
When you remove the comments from your Crystal code you are left with:
if (vSALS.IsGroup = 'Yes') then vSALS.Hours * 2
Which can be written in SQL as:
select
ServiceID
, ServiceDate
, Hours
, IsGroup
, case
when IsGroup = 'Yes' then Hours*2
end as GroupHours
from
vSALS
Thanks! Yes, that's what it ended up being... I'm curious, though, if there actually is a translation for "if Previous" to SQL. Thoughts? Thanks again.
– Kounslr
Mar 25 at 18:31
The LEAD and LAG functions provide the functionality to look at next/previous values.
– Steve Phillips
Mar 29 at 15:11
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55315723%2fconvert-crystal-if-previous-to-sql%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
When you remove the comments from your Crystal code you are left with:
if (vSALS.IsGroup = 'Yes') then vSALS.Hours * 2
Which can be written in SQL as:
select
ServiceID
, ServiceDate
, Hours
, IsGroup
, case
when IsGroup = 'Yes' then Hours*2
end as GroupHours
from
vSALS
Thanks! Yes, that's what it ended up being... I'm curious, though, if there actually is a translation for "if Previous" to SQL. Thoughts? Thanks again.
– Kounslr
Mar 25 at 18:31
The LEAD and LAG functions provide the functionality to look at next/previous values.
– Steve Phillips
Mar 29 at 15:11
add a comment |
When you remove the comments from your Crystal code you are left with:
if (vSALS.IsGroup = 'Yes') then vSALS.Hours * 2
Which can be written in SQL as:
select
ServiceID
, ServiceDate
, Hours
, IsGroup
, case
when IsGroup = 'Yes' then Hours*2
end as GroupHours
from
vSALS
Thanks! Yes, that's what it ended up being... I'm curious, though, if there actually is a translation for "if Previous" to SQL. Thoughts? Thanks again.
– Kounslr
Mar 25 at 18:31
The LEAD and LAG functions provide the functionality to look at next/previous values.
– Steve Phillips
Mar 29 at 15:11
add a comment |
When you remove the comments from your Crystal code you are left with:
if (vSALS.IsGroup = 'Yes') then vSALS.Hours * 2
Which can be written in SQL as:
select
ServiceID
, ServiceDate
, Hours
, IsGroup
, case
when IsGroup = 'Yes' then Hours*2
end as GroupHours
from
vSALS
When you remove the comments from your Crystal code you are left with:
if (vSALS.IsGroup = 'Yes') then vSALS.Hours * 2
Which can be written in SQL as:
select
ServiceID
, ServiceDate
, Hours
, IsGroup
, case
when IsGroup = 'Yes' then Hours*2
end as GroupHours
from
vSALS
answered Mar 25 at 9:02
Steve PhillipsSteve Phillips
412
412
Thanks! Yes, that's what it ended up being... I'm curious, though, if there actually is a translation for "if Previous" to SQL. Thoughts? Thanks again.
– Kounslr
Mar 25 at 18:31
The LEAD and LAG functions provide the functionality to look at next/previous values.
– Steve Phillips
Mar 29 at 15:11
add a comment |
Thanks! Yes, that's what it ended up being... I'm curious, though, if there actually is a translation for "if Previous" to SQL. Thoughts? Thanks again.
– Kounslr
Mar 25 at 18:31
The LEAD and LAG functions provide the functionality to look at next/previous values.
– Steve Phillips
Mar 29 at 15:11
Thanks! Yes, that's what it ended up being... I'm curious, though, if there actually is a translation for "if Previous" to SQL. Thoughts? Thanks again.
– Kounslr
Mar 25 at 18:31
Thanks! Yes, that's what it ended up being... I'm curious, though, if there actually is a translation for "if Previous" to SQL. Thoughts? Thanks again.
– Kounslr
Mar 25 at 18:31
The LEAD and LAG functions provide the functionality to look at next/previous values.
– Steve Phillips
Mar 29 at 15:11
The LEAD and LAG functions provide the functionality to look at next/previous values.
– Steve Phillips
Mar 29 at 15:11
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55315723%2fconvert-crystal-if-previous-to-sql%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown