dansimmo
8th January 2003, 23:37
i'm having a report script problem ... i get an

Error: ',' not expected

when i try to compile a report ... I've added the following ...

if tdpur045.cprj > "300000" and
tdpur041.opol = tcittb.standard and
not tdpur045.item in ("Z2342-01", "Z2342-02", "Z2342-03", "Z2342-04", "Z2511-01", "Z2511-02", "Z2511-03", "Z2511-04")
then badcode = 1
endif

but as far as I know that's the correct syntax, any suggestions

mark_h
9th January 2003, 00:32
I did not think you can use "in" in an if statement. I tried once and got an error and never really investigated it, so I could be wrong(not like it is the first time:). Hope someone posts another answer because I tried something like your code. I tried searching the baanboard library but could not find anything that might help.

Mark

NPRao
9th January 2003, 01:02
Yes Mark is right.

You can use the "IN" only in the SQL statements - IN operator (http://www.baanboard.com/programmers_manual_baanerp_help_functions_database_handling_where)

You can modify your statement to use a case on tdpur045.item or you might have to check individual patterns = item or not or you can assign the whole patterns into a string and do a pos() operation on that string to the item code for a match... There are different ways to do this.

dansimmo
9th January 2003, 01:08
thanks guys

lesson learnt ... i changed it to a lot of individual statements ...

if tdpur045.cprj > "300000" and
tdpur041.opol = tcittb.standard and
tdpur045.item <> "Z2342-01" and
tdpur045.item <> "Z2342-02" and
tdpur045.item <> "Z2342-03" and
tdpur045.item <> "Z2342-04" and
tdpur045.item <> "Z2511-01" and
tdpur045.item <> "Z2511-02" and
tdpur045.item <> "Z2511-03" and
tdpur045.item <> "Z2511-04"
then badcode = 1
endif