Query executed successfully but 0 rows

Shreyas Kale 61 Reputation points
2022-08-06T14:14:22.34+00:00

Whenever I am executing SQL query it says "Query executed successfully" but rows count is "0"
I have checked in Query options and "SET PARSEONLY" is not selected.

If I right click on same table and click on "Select Top 1000 rows" then I am able to see Top 1000 rows results but only this query is not returning any rows or results.

Can you please suggest solution on this issue.228793-sql-query.png

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,601 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,544 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Erland Sommarskog 100.8K Reputation points MVP
    2022-08-07T13:17:52.657+00:00

    Not sure what is wrong with my WHERE clause because 1 week back it was working fine.

    Presumably, one week ago you had data for the date that was the current date then. But if the data set has not been refreshed since then, you don't have any data for today.

    Also, that filtering only filters out old rows, but you can still get multiple rows for the same user. Maybe you are looking for the most recent row for each user, no matter the date?

    2 people found this answer helpful.

  2. Erland Sommarskog 100.8K Reputation points MVP
    2022-08-06T15:42:12.683+00:00

    What happens if you comment out that WHERE condition? I don't know anything about your data or tables, but the most likely explanation to me is that there are no rows that fulfil the condition in the WHERE clause.

    1 person found this answer helpful.

  3. Laxmikant 216 Reputation points
    2022-08-06T18:40:26.233+00:00

    remove the where clause from Source Table CTE and try.

    or

    can you query select top 100 EDDateTime, * from PowerBI_Data and paste screenshot of result here.