Following table:
ECNO BRANCH MONTH ISDELETED
1 B1 February 2018 n
2 B3 February 2018 n
3 B3 March 2018 n
4 B1 March 2018 n
5 B2 January 2018 n
6 B3 January 2018 n
Here we need to select according to branch and starting date and end date.
Case1: If branch is B3, starting date and end date is equal then pick according the branch selected.
select * from HR_BULKBILL_DETAILS where BRANCH='B3' AND MONTH='March 2018'
This query works fine
Case 2: If Staring date (Assume January 2018) and End date (Assume Febuary 2018) And Branch b3. How to check this condition in select query
How Check two condition for one field?
Note: (In database we have only column Month:this hold month- year example : Januray 2018) I am using my sql.
We have tried:
select * from HR_BULKBILL_DETAILS where MONTH='February 2018' AND MONTH='March 2018' AND BRANCH='CBE3'
Forgive me if any typo.
My Expected Output is:
ECNO BRANCH MONTH ISDELETED 2 B3 February 2018 n 3 B3 March 2018 n
My Input is user give startedate and end date and brach
Startdate and enddate will be like March 2018