Solved

Select Command "Where Clause"

Posted on 2014-02-22
2
288 Views
Last Modified: 2014-02-23
I have the following select command that has numerous conditions set in my Where Clause or select statement.   I have a dropdownlist named "Sta" where an individual station can be selected to display in the gridview.   There are other conditions that are identified under "Status" that are also displayed for the specific station that determine what data is to be displayed.

In it's current format it is not filtering specifically to the station and displaying only that station information.   I need assistance with the Select Statement Code.


 SelectCommand="SELECT ID, AOSdate, Ship, ArrTime, InFlt, History, ETRDate, ETRTime, Sta, Reason1, Updated, Status, ETR FROM AOS WHERE ((((((((((((((((((((((((((((([Sta] = @Sta) AND (Status = @Status) OR (Status = @Status2) OR (Status = @Status3) OR (Status = @Status4) OR (Status = @Status5) OR (Status = @Status6) OR (Status = @Status7) OR (Status = @Status8) OR (Status = @Status9) OR (Status = @Status10) OR (Status = @Status11) OR (Status = @Status12) OR (Status = @Status13) OR (Status = @Status14) OR (Status = @Status15) OR (Status = @Status16) OR (Status = @Status17) OR (Status = @Status18) OR (Status = @Status19) OR (Status = @Status20) OR (Status = @Status21) OR (Status = @Status22) OR (Status = @Status23) OR (Status = @Status24) OR (Status = @Status25) OR (Status = @Status26) OR (Status = @Status27) OR (Status = @Status28))))))))))))))))))))))))))))) ORDER BY Status" 

Open in new window


 <SelectParameters>

                        <asp:ControlParameter ControlID="Sta" Name="Sta" PropertyName="SelectedValue" 
                            Type="String" />


                        <asp:QueryStringParameter DefaultValue="AOG" Name="Status" 
                           QueryStringField="Status" Type="String" />
			         
		               <asp:QueryStringParameter DefaultValue="AOG - R/T" Name="Status2" 
                           QueryStringField="Status" Type="String" />
			         
                       <asp:QueryStringParameter DefaultValue="Working Spare" Name="Status3" 
                           QueryStringField="Status" Type="String" />		          
                  
                       <asp:QueryStringParameter DefaultValue="Ready Spare" Name="Status4" 
                           QueryStringField="Status" Type="String" />                  
                  
                       <asp:QueryStringParameter DefaultValue="Ready Spare - A/C Hooked - WU-cw" Name="Status5" 
                           QueryStringField="Status" Type="String" />                  
                  
                       <asp:QueryStringParameter DefaultValue="Status Ready Spare - Needs WU-ck" Name="Status6" 
                           QueryStringField="Status" Type="String" />                    
                  
                       <asp:QueryStringParameter DefaultValue="ETOPS - Working" Name="Status7" 
                           QueryStringField="Status" Type="String" />   
                           
                       <asp:QueryStringParameter DefaultValue="High Priority" Name="Status8" 
                           QueryStringField="Status" Type="String" />   
                           
                       <asp:QueryStringParameter DefaultValue="Ready Spare - Needs WU ck" Name="Status9" 
                           QueryStringField="Status" Type="String" /> 
                           
                       <asp:QueryStringParameter DefaultValue="Ready Spare - A/C Hooked - Needs WU" Name="Status10" 
                           QueryStringField="Status" Type="String" />
                           
                       <asp:QueryStringParameter DefaultValue="SOS - Working" Name="Status11" 
                           QueryStringField="Status" Type="String" /> 
                           
                       <asp:QueryStringParameter DefaultValue="AOG - Vendor" Name="Status12" 
                           QueryStringField="Status" Type="String" />                                                                                                                                    
                                
                       <asp:QueryStringParameter DefaultValue="AOG-Sched/Work Elective" Name="Status13" 
                           QueryStringField="Status" Type="String" />			
			
                       <asp:QueryStringParameter DefaultValue="AOG-Sched/Work Required" Name="Status14" 
                           QueryStringField="Status" Type="String" />

                       <asp:QueryStringParameter DefaultValue="Alert ETOPS Fly Day" Name="Status15" 
                           QueryStringField="Status" Type="String" />

                       <asp:QueryStringParameter DefaultValue="Alert Requires Verification Flight" Name="Status16" 
                           QueryStringField="Status" Type="String" />

                       <asp:QueryStringParameter DefaultValue="Alert Domestic Ops Only - Non Etops" Name="Status17" 
                           QueryStringField="Status" Type="String" />           
            
                       <asp:QueryStringParameter DefaultValue="AOG Off Station Repairs" Name="Status18" 
                           QueryStringField="Status" Type="String" />             
			
                       <asp:QueryStringParameter DefaultValue="AOG - SSE ATA Category Item" Name="Status19" 
                           QueryStringField="Status" Type="String" />
                           
                       <asp:QueryStringParameter DefaultValue="MMCO-Open" Name="Status20" 
                           QueryStringField="Status" Type="String" />                           
                                      
                       <asp:QueryStringParameter DefaultValue="Alert ETOPS Qualified" Name="Status21" 
                           QueryStringField="Status" Type="String" />              
            
                       <asp:QueryStringParameter DefaultValue="ETOPS Fly Day" Name="Status22" 
                           QueryStringField="Status" Type="String" />
                           
                       <asp:QueryStringParameter DefaultValue="AOG Off Station MX Ferry To (LAS)" Name="Status23" 
                           QueryStringField="Status" Type="String" />

                    <asp:QueryStringParameter DefaultValue="MCO-Open" Name="Status24" 
                           QueryStringField="Status" Type="String" />
                            
                    <asp:QueryStringParameter DefaultValue="Charter" Name="Status25" 
                           QueryStringField="Status" Type="String" />       
                                
                    <asp:QueryStringParameter DefaultValue="High Priority-Interior" Name="Status26" 
                            QueryStringField="Status" Type="String" />

                    <asp:QueryStringParameter DefaultValue="High Priority-Exterior" Name="Status27" 
                            QueryStringField="Status" Type="String" />
                           
                    <asp:QueryStringParameter DefaultValue="Charter Tech Req" Name="Status28" 
                            QueryStringField="Status" Type="String" />     
                                                                               
                    </SelectParameters>

Open in new window

0
Comment
Question by:BOEING39
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39879625
That's a lotta brackets

 SelectCommand="SELECT ID, AOSdate, Ship, ArrTime, InFlt, History, ETRDate, ETRTime, Sta, Reason1, Updated, Status, ETR FROM AOS WHERE [Sta] = @Sta AND (Status = @Status OR Status = @Status2 OR Status = @Status3 OR Status = @Status4 OR Status = @Status5 OR Status = @Status6 OR Status = @Status7 OR Status = @Status8 OR Status = @Status9 OR Status = @Status10 OR Status = @Status11 OR Status = @Status12 OR Status = @Status13 OR Status = @Status14 OR Status = @Status15 OR Status = @Status16 OR Status = @Status17 OR Status = @Status18 OR Status = @Status19 OR Status = @Status20 OR Status = @Status21 OR Status = @Status22 OR Status = @Status23 OR Status = @Status24 OR Status = @Status25 OR Status = @Status26 OR Status = @Status27 OR Status = @Status28) ORDER BY Status" 

Open in new window

0
 

Author Closing Comment

by:BOEING39
ID: 39881525
Thx
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now