SQL Between
SQL Between Example One
Select Thespian_Last_Name, Thespian_First_Name
From Thespian_Table
Where Thespian_Last_Name between "Nichols" and "Nickerson";
Nicholson, Jack Nicholson, Nick
SQL Between Example Two
Select Film_Year, Film_Title
From Film_Table
Where Film_Year between "1994" and "2000"
and Film_Title in
(Select Film_Title
From Thespian_Film_Table
Where Thespian_Last_Name = "Nicholson"
and Thespian_First_Name = "Jack");
1995, Mars Attacks 1997, As Good As It Gets
Special Thanks: to Peter Willadt for reminding me of the above.
| Sign In |
| to add your own comment |
| Comment by neoguru Rate this Comment |
<i> |
| Comment by TheMadProfessor Rate this Comment |
In the sample tables, Film_Year is a string, not a number, which is why the samples show the values of the BETWEEN clause in quotes. In your case, since your field is a date or date_time type, the values of your BETWEEN clause must be formatted appropriately.
|
| Comment by archive Rate this Comment |
Is it possible to select records using the 'between' method, when comparing dates which are formatted mm/dd/yyyy?
|