Ms SQL File for all Ticket Description

hi
i am looking for a the file on sql where all the transaction of the ticked made which are paid for two to three week old

Coz i get this error

and think it is coz
shisha\hookah has “” this on it

Right, so post your SQL code. You will probably need to escape backslash (\) in the SQL.

sorry i did not understand

what do you need

[GroupSales:0.2,0.2]
{REPORT ORDER DETAILS:O.ItemGroup,O.ExactTotal.Sum:(ODI=True)}
>Total|{REPORT ORDER DETAILS:O.ExactTotal.Sum:(ODI=True)}

[Sales:0.5,0.2,0.2,0]
@{REPORT ORDER DETAILS:O.MenuItemName,O.ExactTotal.Sum.desc:(ODI=True):{0}:,}
>{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and O.MenuItemName="$1"}
{REPORT ORDER DETAILS:''+[O.PortionName],O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and O.MenuItemName="$1":2}

That ^ … show your SQL script.

[GroupSales:0.2,0.2]
{REPORT ORDER DETAILS:O.ItemGroup,O.ExactTotal.Sum:(ODI=True)}
>Total|{REPORT ORDER DETAILS:O.ExactTotal.Sum:(ODI=True)}
[Sales:0.5,0.2,0.2,0]
@{REPORT ORDER DETAILS:O.MenuItemName,O.ExactTotal.Sum.desc:(ODI=True):{0}:,}
>{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and O.MenuItemName="$1"}
{REPORT ORDER DETAILS:''+[O.PortionName],O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and O.MenuItemName="$1":2}

Is this a product name?? Sounds like it might be.
If it is would guess product name needs a validation adding to prevent backslash… @emre?

it ok i sorted it out found the mssql file it was under Orders table

changed it working fine

thanks all

Can you elaborate so that if it does need product name validation we can let emre know?
It was the backslash in the product name then?

Definitely the backslash, the error message says so… \h is not a valid escape character like \r or \n or \t, etc… best not to use any special characters in your naming conventions.

It would be good to add some verification to the product tab then surely? like we did for [:FieldCarriers] in actions which were also [:Values] within rules?

Heck yah, everywhere.

Programming is difficult especially in terms of validations, since you can never predict what a user is going to do…

So sometimes easier to just tell people to not do something in the first place. :stuck_out_tongue_winking_eye:

If only that was a reliable solution LOL

Given that product name is something that is actually stored independently in historically in the orders table I would argue that in this case validation should defiantly be added moreso that the action field carrier issue which is a non historical easily fixable thing where this would required editing the orders table MenuItemName values for history.

Yes, I understand that, and you’re correct IMO - SambaPOS should perform the validation for Product Names, and probably a lot of other things. Actually, in the DB world, the Product Name would not be stored in Orders at all… it’s [Id] would be stored instead, then you can change the Name whenever you like, and special characters are moot. But then “Apples” could become “Bananas” or “Sprockets” and then you destroy your historical data for finding how many Apples you sold, because now they are Sprockets.

It depends on which type of data we are talking about though, so I understand why Emre did it this way, given we don’t want to ever changes Apples into Sprockets, so the Name is stored instead of the Id.

What else do we deal with though? What about GroupCode ordering? Like a lot of things, it is Alphabetical, so when someone started naming their Groups, they figured they would be smart an prefix them with numbers …

1 Fruit
2 Veggies
...
9 Engine Parts

Then you go over 10 and all hell breaks loose…

1 Fruit
10 Widgets
2 Veggies
...
9 Engine Parts

To fix this “issue”, you prefix your numbers - but wait, think about it first - are you going to surpass 99? If so, better use 3-digit numbers so they alphabetically sort properly!

001 Fruit
002 Veggies
...
009 Engine Parts
010 Widgets
...
100 Poofies
...
207 Fluffballs

I don’t think that type of “ordering” should be something the programmer should have to deal with, so instead we just tell the users how to go about their naming conventions.

I get that but thats an optional thing which isnt potentially causing issues as above :wink:
The 1,10 vs 01,10 is plain logic, like ignoring The on a media server, it doesnt break things is just a preference.

LOL, to you and me it is :wink: