473,750 Members | 2,630 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tricky query

Pea
I'm working with a system usage database. I want to filter out
repetitive logins. The query I have retrieves data like this:

USER_DATE USER_TIME1 USER_USERID USER_ACCOUNT
10/01/2004 19:56 y708ga27 The Capital Group
10/01/2004 19:58 y708ga27 The Capital Group
10/01/2004 19:59 y708ga27 The Capital Group
10/01/2004 20:19 y708ga27 The Capital Group

In a case like this - with consecutive logins for the same user, if
the same user logged in more than once within 30 minutes, I want to
only retrieve one (remove duplicates), provided that the USER_ACCOUNT
is the same:

USER_DATE USER_TIME1 USER_USERID USER_ACCOUNT
10/01/2004 19:56 y708ga27 The Capital Group

Is the best way to do this through a query, report or form?

Thank you,
Tara
Nov 13 '05 #1
1 1393
Pea wrote:
I'm working with a system usage database. I want to filter out
repetitive logins. The query I have retrieves data like this:

USER_DATE USER_TIME1 USER_USERID USER_ACCOUNT
10/01/2004 19:56 y708ga27 The Capital Group
10/01/2004 19:58 y708ga27 The Capital Group
10/01/2004 19:59 y708ga27 The Capital Group
10/01/2004 20:19 y708ga27 The Capital Group

In a case like this - with consecutive logins for the same user, if
the same user logged in more than once within 30 minutes, I want to
only retrieve one (remove duplicates), provided that the USER_ACCOUNT
is the same:

USER_DATE USER_TIME1 USER_USERID USER_ACCOUNT
10/01/2004 19:56 y708ga27 The Capital Group

Is the best way to do this through a query, report or form?

Thank you,
Tara


Yeah, it's tricky. This might be a possibility.

Maybe create a Totals query that would select all records for the UserID
that groups on UserID and counts all records for that userID where the
Date/Time - 30 minutes has a count of 0.

Then create a query to select all records from the table where the
Totals query count is 0 for that useruid, date, time

This may not cover all bases. You'll have to experiment. In the above
example it would.
Nov 13 '05 #2

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

Similar topics

15
2212
by: dracolytch | last post by:
Good day all, Ok, I have a pretty tricky problem that I need some help with. I pass around search query information a fair amount (specifically WHERE statements). Normally, I just rawurlencode() the buggers, and pass them via the URL. I like having the where clauses in the URL, because then someone can just bookmark the URL, or send it to a friend, and I don't have to worry about a thing. If someone does a search that requires a LIKE...
5
4564
by: scott | last post by:
Hello, I'm trying to find the most optimal way to perform a tricky query. I'm hoping this is some sort of standard problem that has been solved before, but I'm not finding anything too useful so far. I have a solution that works (using subqueries), but is pretty slow. Assume I have two tables: ItemID int (Primary Key) ItemSourceID int ItemUniversalKey uniqueidentifier
3
1355
by: Novice | last post by:
Hey all, I've attempted to simplify my question (or at least the XML that is part of my example in my question): I have the following XML: <A> <B><C><D> I want to query the data in this node for the element B </D></C><E> I also want to query the data in this node for the element B </E>
6
1269
by: pointBoarder | last post by:
Thanks in advance to all who read this. I've got 3 tables which were created from a txt file dumped from some old system. Header ID -- autonumber, primary OrderNum -- field I want Line
5
2361
by: ric_deez | last post by:
Hi there, I would like to create a simple search form to allow users to search for a job number based on a number of parameters. I think I understand how to use parameteres associated with Stored Procedures with a data reader to add various parameters. However, if I have a stored procedure such as CREATE usp_SelectfromJobNumbers (@par1 datatype, @par2 datatype, @par3 datatype)
1
1503
by: MorrganMail | last post by:
Or at least I find it tricky. :-) Assume we have three tables A, B and C. Table A contains a path and the distance for traveling that path: A (PathId, NodeId, Dist (from previous node)) 1, 1, 0 1, 2, 10 1, 3, 5
15
5961
by: edouard.spooner | last post by:
Hi, I have a tricky SQL query problem that I'm having probs with. I have a table which resembles something like this Date | Price1 | Price2 | Price3 01 Jan 2006 | 100 | 100 | 100 02 Jan 2006 | 100 | 100 | 100 03 Jan 2006 | 100 | 100 | 100
0
2456
by: hdogg | last post by:
I am using oracle with php. I am trying to accomplish a left outer join. Here are the 3 queries. Query 1, contains all the data on the left the will show up with data on the right. Query 1 = ((SELECT JOB_CODE AS JOBCODE , PERIOD FROM GSI.PCTCOMP_ACC_VW WHERE ( PCT_DATE = TO_DATE('20070228000000','YYYYMMDDHH24MISS') ) AND ( PCT_COMP_CODE = '02' ))) Query 2:
7
1293
by: Whizzo | last post by:
Hi folks; Hope the example data below displays properly for you? CustName FireID CustID PolicyNo PolicyVal BuildingVal Claire Sheene 8 88221 125584 12,500 12,500 Claire Sheene 7 88220 Robin Murphy 9 78552 365557 35,000 35,000 Robin Murphy 6 74859 995554 25,000 This is the datasheet view of some tricky data I'm trying to manhandle. I'm going to be receiving 25000...
0
9001
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9396
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9342
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6808
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6081
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4716
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4888
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3323
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 we have to send another system
3
2226
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.