473,396 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Showing newer recordset

I am a bit new to coding SQL in the sense of the code. I trying to get it to show only records like posted with in 2 minutes of current time. i got the following code
Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM dbo.RSonline WHERE DateDiff(m,RSdate,GetDate()) BETWEEN 0 AND 1
  3. ORDER BY RSuser ASC
any ideas where i am going wrong. the database sees the RSdate cell as YYYY-MM-DD HH:MM:SS.
Nov 13 '12 #1

✓ answered by Rabbit

m is for month. Use mi or n for minutes.

However, it would be more accurate for you to use seconds and see if it is within 120 seconds. With date diff, it is almost always better to use one grain lower.

2 1941
Rabbit
12,516 Expert Mod 8TB
m is for month. Use mi or n for minutes.

However, it would be more accurate for you to use seconds and see if it is within 120 seconds. With date diff, it is almost always better to use one grain lower.
Nov 13 '12 #2
My final code for others reading this as it works
Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM dbo.RSonline
  3. WHERE DateDiff(N,RSdate,GetDate()) BETWEEN 0 AND 1
Nov 14 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Tom | last post by:
I want to open a recordset object on an .asp page. When I open the recordset I would like to use a stored procedure that expects a parameter to be passed for the stored procedure. I will then use...
7
by: John | last post by:
Hi I have an old access 97 application which I need to upgrade to one of the newer versions. Which of the access versions xp or 2003 should I choose? Which one is more stable? Thanks ...
6
by: lenny | last post by:
Hi, I've been trying to use a Sub or Function in VBA to connect to a database, make a query and return the recordset that results from the query. The connection to the database and the query...
13
by: Jan | last post by:
Hi I have a database that I use to keep track of the sales promotions that we send to companies. I normally send a mailing based on a subset of the companies in the database (found using the...
3
by: Jozef | last post by:
Hello, I'm hoping enough time has passed now that someone could tell me what methods have replaced the Database / Workspace / TableDef collections in Access XP. I've tried asking this question...
14
by: Karl Irvin | last post by:
While adding data to a record set, I use something like rst! = some variable rst! = some variable ...... rst! = some variable The rst! , rst! etc. are manually typed in and it gets...
7
by: needin4mation | last post by:
Hi, I have an Access 2002 - 2003 database. I am using Access 2003. Whenever I link an image all it shows is the filename. Not the image. Other versions of Access can link the image just fine. ...
1
by: Colin Clark | last post by:
Hello, I have a database of scores for a sports club. I want to display a continuous subform showing a person's scores for the season along with a running calculation based on those scores (the...
5
by: downwitch | last post by:
I have the strangest error, and wonder if anyone else has seen it. I'm using ADODB to return a set of SQL Server 2005 records via ODBC. If I open the recordset this way With cmd .CommandType =...
3
by: aditi123 | last post by:
I have set RemovePreviousVersions to true and increased the version number. It is working as expected. But what I want is Show a message before the installation starts, asking the user if the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
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...
0
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...
0
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,...

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.