April 8, 2016 at 7:52 am
Hi all,
I want to pull data for only today on a table having datetime column.
Please help
April 8, 2016 at 7:57 am
DECLARE @Today DATE = GETDATE();
WHERE <the datetime column> >= @Today and <the datetime column> < DATEADD(dd,1,@Today)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
April 8, 2016 at 8:55 am
Hi
I am unable to fetch data using that query is that the complete query or do i need to do any changes in it.
i couldn't see any select in that .I am new to this so i don't know much.
April 8, 2016 at 8:58 am
Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'WHERE'.
April 8, 2016 at 9:58 am
m.rajesh.uk (4/8/2016)
HiI am unable to fetch data using that query is that the complete query or do i need to do any changes in it.
i couldn't see any select in that .I am new to this so i don't know much.
You will need to incorporate the above WHERE clause into your SELECT query and use your table/field names.
April 8, 2016 at 11:47 am
m.rajesh.uk (4/8/2016)
I am unable to fetch data using that query is that the complete query or do i need to do any changes in it.
Maybe start with a basic SQL tutorial, if you don't even know the form of a query.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply