I want to retrieve the records of Visits based on Date in the data grid
Note : the visitors in table differ than Viait info and they are conected by Visit id
I want to retrieve the records of Visits based on Date in the data grid
Note : the visitors in table differ than Viait info and they are conected by Visit id
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Tuhin PaulPosted Mar 3, 2023, 10:42 PM
Hi,
Assuming you have two tables: visitors and visits, where visitors contains information about the visitors and visits contains information about the visits, and the two tables are connected by the Visit ID column, you can use the following SQL query to retrieve the visits on a specific date:
This query uses an INNER JOIN to combine the visits and visitors tables based on the Visit ID column. The WHERE clause filters the results by the VisitDate column, which is converted to a date format using the DATE() function, and matches it with the desired date.
Once you have retrieved the records using this query, you can display them in a data grid using any library or framework that you prefer. Some popular options include jQuery DataTables, Bootstrap Table, and Ag-Grid. You can pass the data from the SQL query to the data grid library to populate the grid with the visit information.