Skip to content
Advertisement

SQL query to display data in gridview

I have a grid view that displays data from a SQL Server database during page load. My gridview contains these columns:

I have used a query:

which will display data from SQL Server in the gridview when ReturnedOn column doesn’t have any data.

The new query has to satisfy these conditions,

  1. It Should not displays a record when Assetype=”Laptop” or “Desktop” and IssuedOn is not empty.
  2. But if the Assetype=”Laptop” or “Desktop” and IssuedOn is empty it should display the record.
  3. If the Assetype=anything and Returnedon is not empty it should not display that record in gridview.

Advertisement

Answer

I hope this query resolves your issue.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement