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

Developer technologies | Transact-SQL
SQL Server | Other
{count} votes

3 answers

Sort by: Most helpful
  1. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    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 121.4K Reputation points MVP Volunteer Moderator
    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 221 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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.