I need to get a record set of a weekday (Second Example), where for this I have a field in the table of type datetime.
In Sql it would look something like this:
SELECT AVG(P.Quant) AS Expr1
FROM P
WHERE (Pro.Tipo = 'B') AND (V.ID= 1)
AND EXTRACT(DOW FROM P.data) = 1