GabrielVA
25th October 2010, 17:29
Hey everyone. Is there some sort of a wildcard varilable or code in BaaN that could help my statement?


valid.emno = select.emno.info()
if employee = 0 then
|this is a required field
tccom001.nama = logname$

I want the logic to replace 0 with a wildcard as I have several employees to which might be 123456, etc, etc, for example. I want everything in the employee field to translate, not just 0. Is there a wildcard like in a MS SQL for example (select * from DB)

Thanks

GabrielVA

george7a
25th October 2010, 18:30
What are the "legal" conditions that you need. if there is a lot of them I would write a function like:

function domain tcbool isLegalEmployee(long curr.emno)
{

if curr.emno = 0 then
return(true)
endif

if curr.emno > 1234 and curr.emno < 2123 then
return(true)
endif

| more ifs ...

return(false)
}


Then you can use this function in your code above.

mark_h
25th October 2010, 20:43
Yes - there are wild card options for the select statement. But as George mentioned what are you trying to do? Because you do not really need a wild card to either get all the records or a specific employee ID. George demonstrated how you can just execute code for a range.

GabrielVA
26th October 2010, 20:34
Thanks, I used this Like George did and it didnt work, kept giving me an error with the < and >. Im trying to basically tell the report that if something is int he emno field, then it needs to equal the logname$.

george7a
27th October 2010, 08:56
Please post your code.

GabrielVA
28th October 2010, 14:48
Thanks. I have a field called employee (the employee ID number) that is on a form and I also have next to it tccom001.nama, which it the employee name. I have been tasked to see if I could somehow use the current login (logname$) to match up the logname$ with the employee number but I cant seem to find a table withing BaaN here that has all that as our tables dont list all three, only two of the three. I figured there would be a master employee table of some sort that would house all of the information. So Im trying to find a was to automatically populate the current users employee number, as the tccom001.nama changes based on the empliyee number.