I want to make a select query with an and condition.
dept, divi, comp as string
Deparment = dept
Division = divi
company = comp
Tried this query:
Select *
from table
where
department = '" & dept & "'
and division = '" & divi & "'
and Company = '" & comp & "'
The above query is working if the dept, divi, comp values are available.
Conditions
If user select department only, it should display all value for that selected department only
If user select department and company means, it should display selected company and selected department for that company
If user select department, division and company means, it should display selected company, selected division for that company, selected department for that division.
How to make this select query?
I think this may help you: