Syntax stupid question
![](https://s3-us-west-2.amazonaws.com/media.forumbee.com/i/fe979489-9544-4e25-a682-6b5f73e564b8/h/547.png)
Hi, for sure will be a stupid thing but I can't figure out where I'm wrong in the syntax of this formula. Can anyone help me please? Thanks
6 replies
-
I'm wondering if you need to bracket the boolean logic
select Jobs where Stato = 2 and 'Stato lavorazione FOTO' = 4 and ( 'Stato Album' = 1 or 'Stato Album' = 3 or 'Stato Album' = 4 )
and I don't think you should have a select statement wrapped within an if statement in a view, better to put this in Display field only, if:
'Gestione album' = 3
Regards John
-
You can try:
select Jobs where Stato = 2 and 'Stato lavorazione FOTO' = 4 and 'Stato Album' =1 or 'Stato Album' = 3 or 'Stato Album' = 4
No need to repeat the first two since they are the same.
-
I was wrong. I just tried it out and your first code is correct.
Looking at it again, you have selected records in Jobs that match your search parameters but you don't tell Ninox what do with it.
If you take the select statement and put it in a formula field, Ninox will not display anything. Even though it has gone and found the records. To see it, take the select statement and put it in a variable then do a concat.
let x := (select Jobs....) concat(x)
You could make it one line but with your long select statement it can be hard to read. You will now see the record Ids of the found set. This is only for testing. You don't need to concat in your final code, unless that is what you want.
So you have to decide what you want Ninox to do with the found set. Do you want to count? sum? avg? concatenate? This can also apply to a specific field in the found set.
-
Thanks Fred, surely I was wrong because I have not entered all the information. This formula is for a view that shows only the records that meet the required parameters. So in this case the result is the display of those records
-
Does the select work in view by itself?
maybe the if statement doesn’t return true?
Content aside
- Status Answered
- 2 yrs agoLast active
- 6Replies
- 126Views
-
3
Following