Using ‘IF’ statements in query/400

5 pts.
Tags:
IF statement
Query/400
I need to create a work field that will be populated differently, dependin on a series of 'If' statements. Ex: If TMRPER = 'M', use TMRFRQ value. If TMRPER = 'D', then use TMRFRQ divided by 30, rounded to the nearest whole number. Any idea how to do this?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

The big issue is that you can’t update fields in query/400. Normally, you cannot do any updates in query applications.

Ron

————————————————
Here’s the only way I can think of doing this in query/400
It requires two or three queries
1. Writes to an Outfile for ‘M’ records Setting the WrkFld = TMRFRQ
2. Adds to the Outfile for ‘D’ records Setting the WrkFld = TMRFRQ/30
Then if you need a report
3. Uses the Outfile to write your report.

Phil

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: