Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 299
  • Last Modified:

Select Command "Where Clause"

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
BOEING39
Asked:
BOEING39
1 Solution
 
GaryCommented:
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
 
BOEING39Author Commented:
Thx
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now