laravel nova lense raw query The Next CEO of Stack OverflowInserting multiple rows in a single SQL query?Join vs. sub-queryFurther filter SQL resultsHow to query MongoDB with “like”?How Do I Get the Query Builder to Output Its Raw SQL Query as a String?Laravel migration raw sql errorLaravel Nova: authenticate with PassportTesting Laravel NovaLaravel Nova Action FieldsLaravel Nova - Point Nova path to resource page

Is this a new Fibonacci Identity?

Is it possible to make a 9x9 table fit within the default margins?

How badly should I try to prevent a user from XSSing themselves?

"Eavesdropping" vs "Listen in on"

Why did the Drakh emissary look so blurred in S04:E11 "Lines of Communication"?

Small nick on power cord from an electric alarm clock, and copper wiring exposed but intact

Is it correct to say moon starry nights?

How to coordinate airplane tickets?

Was the Stack Exchange "Happy April Fools" page fitting with the 90s code?

Mathematica command that allows it to read my intentions

What steps are necessary to read a Modern SSD in Medieval Europe?

What does this strange code stamp on my passport mean?

How can I separate the number from the unit in argument?

What difference does it make matching a word with/without a trailing whitespace?

Gauss' Posthumous Publications?

Is a distribution that is normal, but highly skewed, considered Gaussian?

Compensation for working overtime on Saturdays

Shortening a title without changing its meaning

That's an odd coin - I wonder why

Would a grinding machine be a simple and workable propulsion system for an interplanetary spacecraft?

Incomplete cube

Why do we say “un seul M” and not “une seule M” even though M is a “consonne”?

My ex-girlfriend uses my Apple ID to login to her iPad, do I have to give her my Apple ID password to reset it?

Is it possible to create a QR code using text?



laravel nova lense raw query



The Next CEO of Stack OverflowInserting multiple rows in a single SQL query?Join vs. sub-queryFurther filter SQL resultsHow to query MongoDB with “like”?How Do I Get the Query Builder to Output Its Raw SQL Query as a String?Laravel migration raw sql errorLaravel Nova: authenticate with PassportTesting Laravel NovaLaravel Nova Action FieldsLaravel Nova - Point Nova path to resource page










0















I"m trying to run raw SQL query on Laravel Nova Lens.
Would you please help me doing it ?



I did try to convert the sql to eloquent query builder.
However its a long code..
Also [Orator][1] does not work any more.



Also if someone can be my online tutor for Laravel nova i would be grateful.



Here is the shortened SQL query:



DECLARE @from_month INT;
DECLARE @to_month INT;
DECLARE @month_range INT;
DECLARE @year_monitor INT;
DECLARE @text_match_on_item_name VARCHAR(50);
DECLARE @Customer_id VARCHAR(50) ;
DECLARE @doc_type VARCHAR(50) ;

SET @from_month =10;
SET @to_month = 12;
SET @month_range = 4;
SET @year_monitor = 2018;
SET @text_match_on_item_name = '%';
SET @Customer_id ='%'; -- in order to select all id's enter '%'
SET @doc_type = '%מס%';



SELECT
i.item_num AS ItemNum,
i.item_name AS ItemName,
i.itm_qnt AS Stock,
sum(d.itm_qnt_out-d.itm_qnt_in) AS QTOUT,

CASE WHEN i.itm_qnt>0 THEN
sum(CASE WHEN DatePart(mm,[invdate]) BETWEEN @from_month AND @to_month THEN d.itm_qnt_out-d.itm_qnt_in ELSE 0 END ) -i.itm_qnt
ELSE
sum(CASE WHEN DatePart(mm,[invdate]) BETWEEN @from_month AND @to_month THEN d.itm_qnt_out-d.itm_qnt_in ELSE 0 END )
END
AS [PERIODICAL OEDER],

/* IF stock>0 THEN yearly_order = YearlySales-Stock ELSE yearly_order = YearlySales */
CASE WHEN i.itm_qnt>0 THEN
sum(d.itm_qnt_out-d.itm_qnt_in)-i.itm_qnt
ELSE
sum(d.itm_qnt_out-d.itm_qnt_in)
END
AS [YEARLY OEDER],



sum(CASE WHEN DatePart(mm,[invdate]) = '12' THEN d.itm_qnt_out-d.itm_qnt_in ELSE 0 END) AS December


/*Repeat for every month*/

FROM
turtle.dbo.t_items AS i
FULL OUTER JOIN
turtle.dbo.t_items_dtl AS d ON i.item_num = d.item_num
WHERE DatePart(YEAR, [invdate]) = @year_monitor and d.asmachta like @doc_type
and i.item_name like '%'+@text_match_on_item_name+'%' and cust_id like @Customer_id and
i.item_num not in (0, 3318,3310,3319,3309,3638,3052) -- מוצרים להשכרה שלא צריכים להופיע

GROUP BY
i.item_num, i.item_name, i.itm_qnt
order by
[PERIODICAL OEDER] desc









share|improve this question




























    0















    I"m trying to run raw SQL query on Laravel Nova Lens.
    Would you please help me doing it ?



    I did try to convert the sql to eloquent query builder.
    However its a long code..
    Also [Orator][1] does not work any more.



    Also if someone can be my online tutor for Laravel nova i would be grateful.



    Here is the shortened SQL query:



    DECLARE @from_month INT;
    DECLARE @to_month INT;
    DECLARE @month_range INT;
    DECLARE @year_monitor INT;
    DECLARE @text_match_on_item_name VARCHAR(50);
    DECLARE @Customer_id VARCHAR(50) ;
    DECLARE @doc_type VARCHAR(50) ;

    SET @from_month =10;
    SET @to_month = 12;
    SET @month_range = 4;
    SET @year_monitor = 2018;
    SET @text_match_on_item_name = '%';
    SET @Customer_id ='%'; -- in order to select all id's enter '%'
    SET @doc_type = '%מס%';



    SELECT
    i.item_num AS ItemNum,
    i.item_name AS ItemName,
    i.itm_qnt AS Stock,
    sum(d.itm_qnt_out-d.itm_qnt_in) AS QTOUT,

    CASE WHEN i.itm_qnt>0 THEN
    sum(CASE WHEN DatePart(mm,[invdate]) BETWEEN @from_month AND @to_month THEN d.itm_qnt_out-d.itm_qnt_in ELSE 0 END ) -i.itm_qnt
    ELSE
    sum(CASE WHEN DatePart(mm,[invdate]) BETWEEN @from_month AND @to_month THEN d.itm_qnt_out-d.itm_qnt_in ELSE 0 END )
    END
    AS [PERIODICAL OEDER],

    /* IF stock>0 THEN yearly_order = YearlySales-Stock ELSE yearly_order = YearlySales */
    CASE WHEN i.itm_qnt>0 THEN
    sum(d.itm_qnt_out-d.itm_qnt_in)-i.itm_qnt
    ELSE
    sum(d.itm_qnt_out-d.itm_qnt_in)
    END
    AS [YEARLY OEDER],



    sum(CASE WHEN DatePart(mm,[invdate]) = '12' THEN d.itm_qnt_out-d.itm_qnt_in ELSE 0 END) AS December


    /*Repeat for every month*/

    FROM
    turtle.dbo.t_items AS i
    FULL OUTER JOIN
    turtle.dbo.t_items_dtl AS d ON i.item_num = d.item_num
    WHERE DatePart(YEAR, [invdate]) = @year_monitor and d.asmachta like @doc_type
    and i.item_name like '%'+@text_match_on_item_name+'%' and cust_id like @Customer_id and
    i.item_num not in (0, 3318,3310,3319,3309,3638,3052) -- מוצרים להשכרה שלא צריכים להופיע

    GROUP BY
    i.item_num, i.item_name, i.itm_qnt
    order by
    [PERIODICAL OEDER] desc









    share|improve this question


























      0












      0








      0








      I"m trying to run raw SQL query on Laravel Nova Lens.
      Would you please help me doing it ?



      I did try to convert the sql to eloquent query builder.
      However its a long code..
      Also [Orator][1] does not work any more.



      Also if someone can be my online tutor for Laravel nova i would be grateful.



      Here is the shortened SQL query:



      DECLARE @from_month INT;
      DECLARE @to_month INT;
      DECLARE @month_range INT;
      DECLARE @year_monitor INT;
      DECLARE @text_match_on_item_name VARCHAR(50);
      DECLARE @Customer_id VARCHAR(50) ;
      DECLARE @doc_type VARCHAR(50) ;

      SET @from_month =10;
      SET @to_month = 12;
      SET @month_range = 4;
      SET @year_monitor = 2018;
      SET @text_match_on_item_name = '%';
      SET @Customer_id ='%'; -- in order to select all id's enter '%'
      SET @doc_type = '%מס%';



      SELECT
      i.item_num AS ItemNum,
      i.item_name AS ItemName,
      i.itm_qnt AS Stock,
      sum(d.itm_qnt_out-d.itm_qnt_in) AS QTOUT,

      CASE WHEN i.itm_qnt>0 THEN
      sum(CASE WHEN DatePart(mm,[invdate]) BETWEEN @from_month AND @to_month THEN d.itm_qnt_out-d.itm_qnt_in ELSE 0 END ) -i.itm_qnt
      ELSE
      sum(CASE WHEN DatePart(mm,[invdate]) BETWEEN @from_month AND @to_month THEN d.itm_qnt_out-d.itm_qnt_in ELSE 0 END )
      END
      AS [PERIODICAL OEDER],

      /* IF stock>0 THEN yearly_order = YearlySales-Stock ELSE yearly_order = YearlySales */
      CASE WHEN i.itm_qnt>0 THEN
      sum(d.itm_qnt_out-d.itm_qnt_in)-i.itm_qnt
      ELSE
      sum(d.itm_qnt_out-d.itm_qnt_in)
      END
      AS [YEARLY OEDER],



      sum(CASE WHEN DatePart(mm,[invdate]) = '12' THEN d.itm_qnt_out-d.itm_qnt_in ELSE 0 END) AS December


      /*Repeat for every month*/

      FROM
      turtle.dbo.t_items AS i
      FULL OUTER JOIN
      turtle.dbo.t_items_dtl AS d ON i.item_num = d.item_num
      WHERE DatePart(YEAR, [invdate]) = @year_monitor and d.asmachta like @doc_type
      and i.item_name like '%'+@text_match_on_item_name+'%' and cust_id like @Customer_id and
      i.item_num not in (0, 3318,3310,3319,3309,3638,3052) -- מוצרים להשכרה שלא צריכים להופיע

      GROUP BY
      i.item_num, i.item_name, i.itm_qnt
      order by
      [PERIODICAL OEDER] desc









      share|improve this question
















      I"m trying to run raw SQL query on Laravel Nova Lens.
      Would you please help me doing it ?



      I did try to convert the sql to eloquent query builder.
      However its a long code..
      Also [Orator][1] does not work any more.



      Also if someone can be my online tutor for Laravel nova i would be grateful.



      Here is the shortened SQL query:



      DECLARE @from_month INT;
      DECLARE @to_month INT;
      DECLARE @month_range INT;
      DECLARE @year_monitor INT;
      DECLARE @text_match_on_item_name VARCHAR(50);
      DECLARE @Customer_id VARCHAR(50) ;
      DECLARE @doc_type VARCHAR(50) ;

      SET @from_month =10;
      SET @to_month = 12;
      SET @month_range = 4;
      SET @year_monitor = 2018;
      SET @text_match_on_item_name = '%';
      SET @Customer_id ='%'; -- in order to select all id's enter '%'
      SET @doc_type = '%מס%';



      SELECT
      i.item_num AS ItemNum,
      i.item_name AS ItemName,
      i.itm_qnt AS Stock,
      sum(d.itm_qnt_out-d.itm_qnt_in) AS QTOUT,

      CASE WHEN i.itm_qnt>0 THEN
      sum(CASE WHEN DatePart(mm,[invdate]) BETWEEN @from_month AND @to_month THEN d.itm_qnt_out-d.itm_qnt_in ELSE 0 END ) -i.itm_qnt
      ELSE
      sum(CASE WHEN DatePart(mm,[invdate]) BETWEEN @from_month AND @to_month THEN d.itm_qnt_out-d.itm_qnt_in ELSE 0 END )
      END
      AS [PERIODICAL OEDER],

      /* IF stock>0 THEN yearly_order = YearlySales-Stock ELSE yearly_order = YearlySales */
      CASE WHEN i.itm_qnt>0 THEN
      sum(d.itm_qnt_out-d.itm_qnt_in)-i.itm_qnt
      ELSE
      sum(d.itm_qnt_out-d.itm_qnt_in)
      END
      AS [YEARLY OEDER],



      sum(CASE WHEN DatePart(mm,[invdate]) = '12' THEN d.itm_qnt_out-d.itm_qnt_in ELSE 0 END) AS December


      /*Repeat for every month*/

      FROM
      turtle.dbo.t_items AS i
      FULL OUTER JOIN
      turtle.dbo.t_items_dtl AS d ON i.item_num = d.item_num
      WHERE DatePart(YEAR, [invdate]) = @year_monitor and d.asmachta like @doc_type
      and i.item_name like '%'+@text_match_on_item_name+'%' and cust_id like @Customer_id and
      i.item_num not in (0, 3318,3310,3319,3309,3638,3052) -- מוצרים להשכרה שלא צריכים להופיע

      GROUP BY
      i.item_num, i.item_name, i.itm_qnt
      order by
      [PERIODICAL OEDER] desc






      sql laravel laravel-nova






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 21 at 15:58









      Saumini Navaratnam

      4,96011746




      4,96011746










      asked Mar 8 at 19:26









      David GabbayDavid Gabbay

      173




      173






















          0






          active

          oldest

          votes












          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%2f55069746%2flaravel-nova-lense-raw-query%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          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%2f55069746%2flaravel-nova-lense-raw-query%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

          Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

          2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

          Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme