Looking at your examples, I'm not sure why you are getting so complicated. To find out the records that are in the future, you would do so like this:
SELECT *
FROM tblPhoneAsign
WHERE receivedTime > GETDATE()
If you are concerned about only having the date and not the time, you could so something like this:
SELECT *
FROM tblPhoneAsign
WHERE receivedTime > CAST(FLOOR(CAST(GETDATE() AS FLOAT))AS DATETIME)
That will give you only the date portion of today's date. Doing the adding of zero hours to the
GETDATE
method is a very complex and costly way of doing things.
As for why the method doesn't work when you call it from code, I would try the code I listed above. If that doesn't work, try knocking off the
WHERE
statement entirely and seeing if anything comes back. If it doesn't, you know it isn't the fault of the query but instead it is your code. Maybe your connection string is wrong.