Today's date not located in table (1 Viewer)

Kayleigh

Member
Local time
Today, 16:33
Joined
Sep 24, 2020
Messages
706
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();
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 08:33
Joined
Aug 30, 2003
Messages
36,126
GetDate() returns the data and time (like Now()), so you'll have to cast that too.
 

Users who are viewing this thread

Top Bottom