Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Select Command "Where Clause"

Posted on 2014-02-22
2
Medium Priority
?
297 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

670 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