Simple DateTime sql query

0 votes

How do I query the DateTime database field within a certain range?

Error code below: 

SELECT * 
  FROM TABLENAME 
 WHERE DateTime >= 12/04/2011 12:00:00 AM 
   AND DateTime <= 25/05/2011 3:53:04 AM

Note: I am using SQL SERVER 2005 and I want to get rows within a certain time range. For example, 10 mins time range. 

Can someone please help me with this?

Aug 12, 2022 in Database by Kithuzzz
• 38,010 points
427 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Database

0 votes
0 answers

SQL query to insert datetime in SQL Server

Using the SQL query below, I want ...READ MORE

Aug 29, 2022 in Database by Kithuzzz
• 38,010 points
1,838 views
0 votes
2 answers

Write a SQL query to find the names of employees that begin with ‘S’

Select ename From emp Where ename like"s%"; READ MORE

answered Oct 7, 2021 in Database by anonymous
25,464 views
0 votes
1 answer

What is the SQL query to get the third highest salary of an employee from employee_table

You can try out something like this: SELECT ...READ MORE

answered Sep 27, 2018 in Database by Sahiti
• 6,370 points
11,587 views
0 votes
1 answer

How to schedule a job for SQL query to run daily?

down voteaccepted Expand the SQL Server Agent node ...READ MORE

answered Oct 25, 2018 in Database by Frankie
• 9,830 points
9,788 views
0 votes
1 answer

How to schedule a job for sql query to run daily?

Hii, To schedule a job for sql query ...READ MORE

answered May 4, 2020 in Database by Niroj
• 82,880 points
3,694 views
0 votes
0 answers

Request for SQL Query

Hi team, How can I get a distinct ...READ MORE

Jun 8, 2020 in Database by vnk
• 390 points
493 views
0 votes
0 answers

Selecting COUNT(*) with DISTINCT

In SQL Server 2005, I have a ...READ MORE

Feb 14, 2022 in Database by Neha
• 9,060 points
313 views
0 votes
0 answers

How to update Identity Column in SQL Server?

With 200 records currently, I want to ...READ MORE

Aug 9, 2022 in Database by Kithuzzz
• 38,010 points
1,093 views
0 votes
0 answers

What represents a double in sql server?

I have several properties in C# which ...READ MORE

Aug 13, 2022 in Database by Kithuzzz
• 38,010 points
558 views
0 votes
0 answers

How can I select the first day of a month in SQL?

I only need to choose the given ...READ MORE

Aug 14, 2022 in Database by Kithuzzz
• 38,010 points
401 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP