Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 I want to serach by some condition ..

Author  Topic 

asifbhura
Posting Yak Master

165 Posts

Posted - 2010-09-06 : 10:16:28
Hi

I want to filter table by some condition

I have search option such as offerno,startdate,enddate and registrationDate

and even I have search type like inside,outside or both

now I want to search record by selection by search option and search type.

depend on selection of options column name will be changed

Regards,
ASIF

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-09-06 : 14:16:46
whats inside,outside etc? didnt understand its relevance

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

jcelko
Esteemed SQL Purist

547 Posts

Posted - 2010-09-07 : 17:57:58
Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Please learn to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect.

Sample data is also a good idea, along with clear specifications. It is very hard to debug code when you do not let us see it. If you want to learn how to ask a question on a Newsgroup, look at: http://www.catb.org/~esr/faqs/smart-questions.html

You have described a procedural approach and not a declarative.


--CELKO--
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
Go to Top of Page
   

- Advertisement -