Searching between two dates

Asked

Viewed 85 times

0

I have a C# program that assembles a report and can filter by name, but I want to go further, I wanted to pull all the records between two dates. Good as I do to assemble the WHERE of that filter by dates ?

Since I already have a Tableadapter in which it filters my records by name

Code of what you name:

SELECT `ID_Pacote`, `Nome`, `peca`, `Quantidade`, `Data_entrada`, `Data_saida` FROM `pacote`
WHERE Nome = @nome
  • Please avoid long discussions in the comments; your talk was moved to the chat

1 answer

2


Test like this:

SELECT `ID_Pacote`, `Nome`, `peca`, `Quantidade`, `Data_entrada`, `Data_saida` 
FROM `pacote`
WHERE data_entrada between @data1 and @data2.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.