473,396 Members | 2,093 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.

Obtain unique data sets (rows)

hi,

Can anyone help with this? Something seems to be wrong except I cant figure out what it is.

I am trying to sort my data such that if [SP].time has appeared when [SP].series = "SPJ14-SPK14" then the data for the other 2 series will not show up. i.e. SPJ14 and SPK14. In other words, the time is unique.



Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT Last([SP].Series) AS LastOfSeries, [SP].Time, [SP].BidOrAsk, [SP].Price, Max(Len([Series])) AS Length
  2. FROM [SP]
  3. GROUP BY [SP].Time, [SP].BidOrAsk, [SP].Price
  4. HAVING (((Last([SP].Series))="SPJ14" Or (Last([SP].Series))="SPK14" Or (Last([SP].Series))="SPJ14-SPK14"))
  5. ORDER BY [SP].Time, Max(Len([Series]));
  6.  

Thanks in advance!
Dec 17 '13 #1
3 1117
zmbd
5,501 Expert Mod 4TB
I think that your issue is here:
(Last([SP].Series))="SPJ14-SPK14"))

It looks like you're asking for a span based on a text value and, to the best of my knowledge that isn't directly possible.

However, without an example of the data it's difficult to tell, can you provide about 4 or 5 lines of the data?

Use the [CODE/] button to insert the following: [code] [/code]

Between these two tags, you can put some fomatted data:
[code][SP].Series, [SP].Time, [SP].BidOrAsk, [SP].Price, [SP].[Series]
[seriesdata1][timedata1][bidoraskdata1] ...
[seriesdata2][timedata2][bidoraskdata2] ...
...[/code]

You might also include an example of what you want to have happen too.

You do NOT need to attach any files at this point.

Next, you really should not use the word "Time" as a field name. It can cause issues as "Time" is a reserved token:
Dec 17 '13 #2
Here's how my data looks like now
Expand|Select|Wrap|Line Numbers
  1. [SP].Series, [SP].Time, [SP].BidorAsk, [SP].Price, len[series]
  2. [SPJ14][11:23:20][Bid][200][5]
  3. [SPJ14][11:23:20][Ask][205][5]
  4. [SPK14][11:23:20][Bid][200][5]
  5. [SPK14][11:23:20][Ask][205][5]
  6. [SPJ14-SPK14][11:23:20][Bid][10][11]
  7.  
  8.  
so when the time is the same such as in the sample data above, I want to hide/delete the series-SPJ14 and SPK14 and just show SPJ14-SPK14


Thanks a lot!

Sorry if I'm not typing or I don't seem to understand much database lingo. This is my first time using access
Dec 19 '13 #3
Rabbit
12,516 Expert Mod 8TB
What you can do is outer join the table to itself on the first half and second half to see if there is one that encompasses multiple records.
Dec 31 '13 #4

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

Similar topics

2
by: gregory_may | last post by:
I am trying to switch to C# from VB. A few things I cant seem to find: * How to get those handy Try/Catch templates to appear when I type "Try" * How can I auto reformat my code?
2
by: g35rider | last post by:
Hi, I have the following code that is giving this error, I cant simplify the code, I was just testing some theory for something we are doing and was getting an issue here. Please someone point out...
6
by: mike11d11 | last post by:
I cant seem to filter down my dataset table by criteria in expression. Can someone tell me why I still have the same amount of rows after I use this filter select option. Private Sub...
1
by: mike11d11 | last post by:
I'm doing a simple TableAdapter.Fill filling my datatable from a view within a SQL database. for some reason it is timing out after 30 seconds and I cant seem to find out where in vb.net 2005 I...
0
by: hwiesmu | last post by:
I have defined a unique data type and some UDF's. After create table with "SET PATH=..." everything works fine. But some standard applications do not deal with "SET PATH=.." and will not work. Is...
0
by: rhyes | last post by:
Hi All, I cant seem to submit post and view the post in the example provided by thescripts there is no error and I manage to connect to the database. the link is below: ...
3
by: Scott2112 | last post by:
Hello, I have a simple datatable ("Co_Size")with non-unique data and I would like to populate a combobox with unique data (VB 2005). I haven't figured it out yet. Any help? Scott
2
by: keirnus | last post by:
Hello, I actually don't know where to post for SQL Queries used in MS Access. If this is not the correct thread, please redirect this to the correct one. Anyway, I am kinda newbie to the query...
0
by: tjn825 | last post by:
cant seem to change the total line name for simple Access Query: Total $450,000 to say Total Cost $450,000
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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.