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.
|Comments Comments are left by visitors to FluffyCat.com and may or may not be accurate.|
|Comment by TheMadProfessor on 2012-09-12 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 on 2007-09-19 Rate this Comment|
Is it possible to select records using the 'between' method, when comparing dates which are formatted mm/dd/yyyy?
|Sign in to comment on SQL Between.|