473,587 Members | 2,229 Online
Bytes | Software Development & Data Engineering Community
+ 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 4701
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
505
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! Much warmth,
2
2459
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. Here it is: mySQL server: version "4.0.20-standard" on localhost hardware : 1.8 MHz Pentium 4 with 512 cache and 512 MB 266MHz RAM and 40 MB...
3
1832
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 records from two or more related tables and edit them. As mentioned in a previous post, I'm currently selecting a record from table 1; editing it,...
29
4324
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 minutes or less (it could vary, and wouldn't necessarily be a convenient round number). This will enable reporting "active time" for users (a...
4
2720
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 timestamp(0), i am trying to select all records within a given date range. I have an index on 'in_date' and I also have an index on date(in_date). The...
4
1528
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 the server. We will be getting comma delimited records that must be inserted into the database. I haven't seen anyone with an example of how this...
4
1934
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
24709
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 pertaining to each event in table1. So for each record in Table1 there could be hundreds of records pertaining to that record in Table2 - I am trying...
1
2812
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 version of the Access table. The importing of the csv and then the outputting to the Access table takes less than 5 minutes, but the deleting of...
0
7915
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8205
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8339
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5712
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.