Results 1 to 3 of 3
Thread: sql question
Jul 2, 2004, 07:11 #1
This query works almost 100%. I'm trying to make so that it will include the records WHERE (tbl33.col13 = recordid16) AND ((tbl33.col17 =0) AND/OR (tbl24.col11=1)). The "((tbl33.col17 =0) AND/OR (tbl24.col11=1))" part of it is where it's messed up. I'm not sure how to specify a condition where the query will accept either value.
This is what I'm trying to use now but it doesn't work.
SELECT tbl24.col2 as col2b, tbl33.col1, tbl33.col3, tbl33.col4, to_char(tbl33.col4, '999,999,999,999,999.99') as col4formatted, tbl33.col5, tbl33.col6, tbl33.col7, tbl33.col13, tbl33.col14, tbl24.col11 as col11b
FROM tbl33 INNER JOIN tbl24 ON tbl33.col3 = tbl24.col1
WHERE (tbl33.col13 = recordid16) AND ((tbl33.col17 =0) OR (tbl24.col11=1))
ORDER BY tbl24.col2 ASC, tbl33.col7 DESC
Jul 2, 2004, 09:09 #2
- Join Date
- Feb 2004
- 0 Post(s)
- 0 Thread(s)
I just tried this in access and it worked for me.
I would put the same equation in parentheses on both sides:
WHERE ((tbl33.col13 = recordid16) AND (tbl33.col17 =0)) OR ((tbl24.col11=1) AND (tbl33.col13 = recordid16))
Jul 2, 2004, 10:08 #3
Thanks for the help!
Originally Posted by matt_12511