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
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
add a comment |
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
add a comment |
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
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
sql laravel laravel-nova
edited Mar 21 at 15:58
Saumini Navaratnam
4,96011746
4,96011746
asked Mar 8 at 19:26
David GabbayDavid Gabbay
173
173
add a comment |
add a comment |
0
active
oldest
votes
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%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
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%2f55069746%2flaravel-nova-lense-raw-query%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