
I want to display records inbetween two dates and also want to use where condition( like and deptname='Pediatry Department').

Syntax:
SELECT column_name(s) FROM table_name WHERE column_name BETWEEN value1 AND value2
Here is an example, we have a table named data(id, name, dob,deptName.....) and we have to find the data of a person whose names starts with r and deptname is software and dob lies between two specified dates.
Here is the query for this:
select * from data where dob between '2005-12-01'and '2005-12-31' and name LIKE 'r%' and deptName='software';
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.