473,473 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Select all records less than 10 minutes old?

Hello All,

I'm wondering if anyone can tell me how to write an SQL statement that
will select all records that are less than 10 minutes old, using a
datetime column?

Any help appreciated!

Much warmth,

Murray
Jul 19 '05 #1
3 4686
M Wells wrote:
Hello All,

I'm wondering if anyone can tell me how to write an SQL statement that
will select all records that are less than 10 minutes old, using a
datetime column?
You could use DATE_SUB() function with NOW() parameter and subtract 10
minutes from it and compare the return value to your column value using or <.


See the syntax and examples from:
http://www.mysql.com/doc/en/Date_and...functions.html
Jul 19 '05 #2
M Wells wrote:
Hello All,

I'm wondering if anyone can tell me how to write an SQL statement that
will select all records that are less than 10 minutes old, using a
datetime column?
You could use DATE_SUB() function with NOW() parameter and subtract 10
minutes from it and compare the return value to your column value using or <.


See the syntax and examples from:
http://www.mysql.com/doc/en/Date_and...functions.html
Jul 19 '05 #3
M Wells wrote:
Hello All,

I'm wondering if anyone can tell me how to write an SQL statement that
will select all records that are less than 10 minutes old, using a
datetime column?
You could use DATE_SUB() function with NOW() parameter and subtract 10
minutes from it and compare the return value to your column value using or <.


See the syntax and examples from:
http://www.mysql.com/doc/en/Date_and...functions.html
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: M Wells | last post by:
Hello All, I'm wondering if anyone can tell me how to write an SQL statement that will select all records that are less than 10 minutes old, using a datetime column? Any help appreciated! ...
2
by: ghasem | last post by:
Dear mySQL community, I have once again turned to the user groups for a problem I cannot solve myself! Atually, I have read all I can from the newsgroups on this but I could not solve it myself....
3
by: William Gill | last post by:
I can't help but think I'm re-inventing the wheel if I have to code my own interface! Isn't there some script, php code, or something (modifiable / customizable) available that lets me select...
29
by: Scott Marquardt | last post by:
Consider a table that holds Internet browsing history for users/machines, date/timed to the minute. The object is to tag all times that are separated by previous and subsequent times by x number of...
4
by: psql-mail | last post by:
I am running a SELECT to get all tuples within a given date range. This query is much slwoer than i expected - am i missing something? I have a table 'meta' with a column 'in_date' of type...
4
by: sparty1022 | last post by:
we are constructing a (sql 2005) database on an FTP server where we will need to insert records into the tables. At this point our ftp scripts will allow us to upload/download documents/file from...
4
by: Jean-Claude | last post by:
Hi, which is the faster query ? (of course, in my case the real queries are more complex) 1/ select * from file1 a join file2 b on b.key=a.key where b.data=123 and b.name='TEST'
6
markrawlingson
by: markrawlingson | last post by:
Hopefully someone can help me out with this, it's driving me nuts... I have two tables - We'll call them table1 and table2. Table1 holds event information, and table2 holds user registration data...
1
by: kilabyte | last post by:
I have a csv file that I download from a remote server every morning at 8am. This is imported in access and written to an Access table on one of the servers, having first deleted the previous days...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.