Reports Question - Not Show null tables

I copied it from QMC lol. So you are saying my sql code is wrong… What confuses me is the fact that it works perfect when I manually enter the dates on there

This works:

It has to do with the structure of it. Look here is a report I did with a long SQL tag notice how i Structured it.

NO im saying you structured the tag wrong. You either need to write it all in one line or structure it correctly if your going to seperate it in multiple lines.

To be honest my SQL skills are not sharp enough to know how to format mine to yours
So ill remove the declares because I dont need those right?

.

No you dont. But you also inserted start and end wrong. It would work with the declares if start and end were correctly used.

You declared them but then didnt use what you declared.

The part that confuses me is you tables and data you are working with is different than mine. Finding kind of difficult to learn from it. I see what you mean by the {Start} tags being different in mine. Im trying to play with them

@{REPORT SQL DETAILS:SELECT
DISTINCT OState_State
FROM [Orders]
CROSS APPLY OPENJSON([OrderStates])
WITH (
OState_StateName varchar(50) ‘$.SN’
,OState_State varchar(50) ‘$.S’
,OState_StateValue varchar(50) ‘$.SV’
)
WHERE 1=1
AND Orders.[CreatedDateTime]>=‘2019-04-26 14:26:42.123’
AND Orders.[CreatedDateTime]<=‘2019-04-28 14:26:42.123’
AND OState_StateName = ‘Void’

;{Start},{End}:F.OState_State::{0},}

So the state is the name of the admin that matched that pin?

Ok so the part your missing and why your tag wont work is you see the very end of my report tag… all the F. fields? Those are where you define the output goes to. That is telling it what to put in each field of the report.

Yeah the admin that authorized it is the state

Your missing those field definitions so the tag has no idea how to structure the report. One sec I will rewrite yours and show you what I mean.

1 Like

Im not sure what to do with the ::{0}, at the bottom. Dont I need the delimeter to add commas?

Thanks Jesse

What is your state name? Its the User right? And the value is? The void reason?

StateName: Void
State: Admin who approved
StateValue: Reason

Order User: user that owned order

What happends if you do this.

@{REPORT ORDER DETAILS:OS.Void}
[$1 Voids :4,2,2,1,1]
{REPORT ORDER DETAILS:O.User,OSV.Void,O.MenuItemName,O.Quantity,O.TotalPrice:(OS.Void=$1)}

If this helps…

Also this…

Ok so one second its almost there.

try this:

@{REPORT ORDER DETAILS:OS.Void,O.Total.sum::{0}}
[$1 Voids :4,2,2,1,1]
{REPORT ORDER DETAILS:O.User,OSV.Void,O.MenuItemName,O.Quantity,O.TotalPrice:(OS.Void=$1)}

Ok try that.

2 Likes

Wow man. You know what I feel like right now. Like the guy that took a walk all around the globe to get home only to come right back to the other side of town ahha.

Ok there you go and it should be bound by dates now.