This is something I have done in the past, but right now I do not have access to the AS400 Querry screen.When you build your query, if I remember correctly, the 2nd selection line allow you to define new fields. Go to that screen and press F1 for HELP. There is detail instructions on how to do what you want.
I have amanged to find an online manual which illustrates how to difine the statement.
Many thanks for your thoughts.