Depends on the DBMS you use.
If it is SQL Server, use the DATEPART function. I will leave it at your discretion to read the documentation on the link. The form would be as follows:
WHERE DATEPART(p.dtvenc, 'weekday') BETWEEN 2 AND 6
Where 2
and Monday and 6
is friday.
If you are an Oracle, you use the form to_char
. which receives a date.
WHERE to_char(p.dtvenc, 'D') in ('2', '3', '4', '5', '6')
Editing: @ Caffé drew attention to the fact that the number corresponding to each day of the week in Oracle may vary. This depends on the language / culture set up. For more details (if you are curious or have problems with numbers), I suggest searching for National Language Support Caffé commented).
If it's MySQL, PostgreSQL or another system ... In this case you expect someone who knows them to respond here. Putting the bank tag you use in the question helps you get better answers.