Negating a where clause
Posted: Thu Jan 26, 2012 10:40 am
OK i have a page which posts to three pages within it like this
http://localhost/EDI_Project/DisplayRes ... orders=yes
http://localhost/EDI_Project/DisplayRes ... nvoice=yes
http://localhost/EDI_Project/DisplayRes ... credit=yes
each one of these links has its own button and code
at the moment i have a basic select stored proc in SQL and it prints a table depending on what one of the above URL's is loaded.
i am now creating a filter for each on of these pages using a drop down
my question is would it be possible to add a where clause to the stored procedure but then if nothing is entered as a parameters it would just display all the records as before. this would really shorten my code if i can just have a where clause that when nothings entered it takes all rows.
thanks in advance
http://localhost/EDI_Project/DisplayRes ... orders=yes
http://localhost/EDI_Project/DisplayRes ... nvoice=yes
http://localhost/EDI_Project/DisplayRes ... credit=yes
each one of these links has its own button and code
at the moment i have a basic select stored proc in SQL and it prints a table depending on what one of the above URL's is loaded.
i am now creating a filter for each on of these pages using a drop down
my question is would it be possible to add a where clause to the stored procedure but then if nothing is entered as a parameters it would just display all the records as before. this would really shorten my code if i can just have a where clause that when nothings entered it takes all rows.
thanks in advance