Results 1 to 2 of 2

Thread: Multiple Criteria In SQL Statement

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2006
    Location
    UK
    Posts
    489

    Multiple Criteria In SQL Statement

    Hi

    I was just wondering if it is possible to specify multiple criterias in one SQL statement such as selecting results where a particular field equals no AND another filed has to be between two dates. I know you cant use multiple where clauses, so I have no idea how its done.

    Help appreicated
    Learning C♯

    Data Binding & Bound Controls - Objects and wizards will never be as intelligent as you, do it yourself! (Unless your Pro)

  2. #2
    Addicted Member
    Join Date
    Jan 2008
    Location
    Pittsburgh
    Posts
    169

    Re: Multiple Criteria In SQL Statement

    Is this what you are looking for?

    Code:
    Select * from table where a=y and datevalue between date1 and date2
    You can have as many criteria as you want to include using AND and OR in the WHERE clause
    If you're going to be crazy, you have to get paid for it or else you're going to be locked up. -- Hunter Thompson

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width