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;








0















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?










share|improve this question






























    0















    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?










    share|improve this question


























      0












      0








      0








      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?










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 23 at 16:15







      Kounslr

















      asked Mar 23 at 16:09









      KounslrKounslr

      33




      33






















          1 Answer
          1






          active

          oldest

          votes


















          0














          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





          share|improve this answer























          • 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











          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
          );



          );













          draft saved

          draft discarded


















          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









          0














          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





          share|improve this answer























          • 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















          0














          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





          share|improve this answer























          • 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













          0












          0








          0







          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





          share|improve this answer













          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






          share|improve this answer












          share|improve this answer



          share|improve this answer










          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

















          • 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



















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript