Today's date not located in table

Kayleigh

Member
Local time
Today, 19:56
Joined
Sep 24, 2020
Messages
709
Hi
I am having trouble with a query in SQL Server. I am trying to locate the records created on today's date.
I have a field which logs the date it is created but whichever way I try, the results are always blank. It does sometimes works in MS Access.
Here is the SQL of my query:
SQL:
SELECT  cast(fldocreated AS Date) AS dates
FROM dbo.tblOrders
WHERE cast(fldocreated AS Date)=getdate();
 
GetDate() returns the data and time (like Now()), so you'll have to cast that too.
 

Users who are viewing this thread

Back
Top Bottom