-3
I need to extract sales from such a date period until such date. For example, between 01/04/2011
and 30/04/2011
.
I am not able to bring the result of the period in question. In this case, I am using the table Adventuresworks2019 from Microsoft to practice.
This is as far as I go:
select pp.productID,
pp.Name as "Descrição do produto",
pp.ProductNumber as "Número do Produto",
po.Unitprice as "Preço Unitário",
po.LineTotal as "valor total",
po.Orderqty as "Quantidade do Produto",
po.duedate as "Data do Pedido"
from production.product pp
inner join Purchasing.PurchaseOrderDetail po
on pp.ProductID = po.ProductID
where DueDate ( Daqui não consigo passar)
I need exactly the period between certain dates.
Also, the field is in format datetime
, that is, the date appears as 2011-04-30 00:00:00:000
, but I want to exhibit how 30/04/2011
.
Should the date "04/30/2011" participate in the result? Is it the full month or really between dates? Is that it has the question of being between inclusive dates or the possibility of excluding the initial and final dates.
– Clarck Maciel
Good morning. So, I need full date , only month day and year, but if I have to convert before ? ie I have to use in select ? or I have to use in whwere? because I have not yet had the expected result , I because within the specified date still has information and is not searching
– Leandro Amorim Viersberg
In your example, you use the start date and the end date representing a full month. Are you always interested in a full month? ex: 05/2020, 06/2020. Or you can have periods between dates, ex: 15/05/2020 to 15/06/2020 ?
– Clarck Maciel
as the field is in datetime format 2011-04-30 00:00:00:000 I want to show only the date I selected between 01/04/2011 until 30/04/2011 but where I use the conversion ? i use in Where or select? Please I need these tips, because in the date and string functions I am still Noob. Thank you.
– Leandro Amorim Viersberg