Toad World® Forums

Adding an OR statement


#1

I have a multiple table query that has an “or” statement in it. I cannot seem to find a way to add another “or” statement. Is there some way to add another “or” statement to the query without submitting it to the editor. I have tried that and am apparently not versed enough in SQL to do it properly.

I would like to add:
VISIT_CHARGES_V.FACILITY_ID = 1
VISITS_V.PATIENT_CLASS <> ‘E’
MST_CHARGES_V.GL_DEPT = 10320
VISIT_CHARGES_V.SERVICE_DATE BETWEEN LAST_DAY(ADD_MONTHS(TRUNC(SYSDATE), -2)) + 1 AND LAST_DAY(ADD_MONTHS(TRUNC(SYSDATE), -1))

The TSM and SQL are attached.

Thanks!

NEW SAM_OR.tsm (344 KB)

Original SAM_OR.docx (15.6 KB)


#2

We made this change in a later version of TDP. Use the Formula tab of the Where Condition editor and type your OR condition in freehand. See screenshot.

Or you can use the Global Where Clause to manually type additional conditions.

Debbie


#3

Thanks! I was able to get it. What version is the additional OR in?


#4

TDA 3.1 (I think)

Debbie


#5

I am using ToadDataPoint_Beta_3.3.0.1168. I do not see where I could add another or line. Where would it be?


#6

It works just as shown in screenshot in TDP 3.3. Open up the Where condition editor. Click on the FORMULA tab. Type directly into the top editor space. You can even make this editor area larger by pulling down on the splitter bar. Or as also mentioned you can use Global Where clause which is located on the tool bar.

Debbie