-2
Well I have a table that contains some tables being them ( DATA_INICIAL , DATA_FINAL ) however I’m trying to generate a report that contains the data between the initial and final dates , and who puts this information is the user ( It is not something defined ) .
My search in the bank today only takes the data of the starting day and the final day yet I want every day within that range , how can I accomplish this ?
My Consultation :
SQL SERVER : SELECT * FROM dbo.NOME_DA_TABELA WHERE DT_INICIAL LIKE '$data_incio' AND DT_FINAL LIKE '$data_final'
- $data_start And $data_final are the variables that users will put in a form that I send to this page .
Do you want the selected records to have both DT_INICIAL and DT_FINAL dates between the initial and final dates provided or just one of them to be within the given period? I believe it is enough to use BETWEEN not understood this LIKE.
– anonimo
I believe you meant 'table that contains some columns'. DATA_INIAL and DATA_FINAL are of what type? If you ran and not error with ilike I believe they are varchar, in this case you need to convert to date and use the between commented above. place the ddl of the table in question.
– mari