New topic: 

How to group SQL statements?

<http://forums.realsoftware.com/viewtopic.php?t=47319>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        tseyfarth          Post subject: How to group SQL 
statements?Posted: Sun Mar 17, 2013 10:44 pm                         
Joined: Sat Dec 04, 2010 9:14 pm
Posts: 853                Hello All,

I need to do something like:
select * from TABLE where FIELD1 >= Date1 and FIELD1  <= Date2 And (FIELD2  
Like "abc" or FIELD2 Like "xyz" or FIELD3 Like "123") sort by Date1

Here is my code:
Select * from "TRANSACTION" where  And "TRANSACTION"."Date In" >= {d 
'2013-01-01'} And "TRANSACTION"."Date In" <= {d '2013-01-01'} And  ( 
"TRANSACTION"."Event Description" = 'Access Granted' Or "TRANSACTION"."Event 
Status" Like 'Entry Granted OK%' Or "TRANSACTION"."Event Status" Like 'Exit 
Granted OK%' Or "TRANSACTION"."Event Status" Like 'Internal Access Allowed%' )  
order by  "TRANSACTION"."Date In", "TRANSACTION"."Time In" ASC;

I can get it all, except for the grouping of the Or's.  No SQL error, but no 
results either.

Thanks in advance to all!
Tim   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to