473,325 Members | 2,785 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,325 software developers and data experts.

Need help in get the result in the format

In the table


sERIES TICKETNO STATUS

THE MIN DIFFERENCE WILL BE BETWEEN 1 ST ROW AND NEXT ROW WILL BE 10000


1 100000 0
1 100000 1
1 120000 0
1 130000 0
1 140000 0
1 150000 1
1 160000 0
1 170000 1
1 180000 0
1 190000 1
1 200000 0

CONTIUNED DEPENDS ON HOW MANY TICKETS ARE ALLOTED




2 100000 0
2 110000 0
2 120000 1
2 130000 1
2 140000 0
2 150000 1
2 160000 1
2 170000 0
2 180000 0
2 190000 1
2 200000 0

CONTIUNED DEPENDS ON HOW MANY TICKETS ARE ALLOTED

3 100000 0
3 110000 0
3 120000 0
3 130000 0
3 140000 0
3 150000 1
3 160000 1
3 170000 0
3 180000 0
3 190000 1
3 200000 0

CONTIUNED DEPENDS ON HOW MANY TICKETS ARE ALLOTED



FROM THIS TABLE QUERY IS




SELECT TOP N TICKETNO FROM TABLE WHERE STATUS=0


TOP N MAY CHANGE, SAY NOW 20

SELECT TOP 20 TICKETNO FROM TABLE WHERE STATUS=0


NOW THE RESUTL SET WILL BE


1 100000 0
1 120000 0
1 130000 0
1 140000 0
1 160000 0
1 180000 0
1 200000 0

2 100000 0
2 110000 0
2 140000 0
2 170000 0
2 180000 0
2 200000 0

3 100000 0
3 110000 0
3 120000 0
3 130000 0
3 140000 0
3 170000 0
3 180000 0



BUT I NEED THE RESULT SET AS

GROUP BY SERIES TICKETNO

11000 IS NOT AVAILABLE
SO

1 100000-100000
1 120000-140000

NOW 150000 IS NOT AVAILABLE

SO

1 160000-160000

BECAUSE 170000 IS NOT AVAILABLE

1 180000-180000

1 200000-200000



NOW THE SERIES CHANGES TO 2

2 100000-110000
2 140000-140000
2 170000-180000
Apr 11 '08 #1
2 1213
siva538
44
In the table


sERIES TICKETNO STATUS

THE MIN DIFFERENCE WILL BE BETWEEN 1 ST ROW AND NEXT ROW WILL BE 10000


1 100000 0
1 100000 1
1 120000 0
1 130000 0
1 140000 0
1 150000 1
1 160000 0
1 170000 1
1 180000 0
1 190000 1
1 200000 0

CONTIUNED DEPENDS ON HOW MANY TICKETS ARE ALLOTED




2 100000 0
2 110000 0
2 120000 1
2 130000 1
2 140000 0
2 150000 1
2 160000 1
2 170000 0
2 180000 0
2 190000 1
2 200000 0

CONTIUNED DEPENDS ON HOW MANY TICKETS ARE ALLOTED

3 100000 0
3 110000 0
3 120000 0
3 130000 0
3 140000 0
3 150000 1
3 160000 1
3 170000 0
3 180000 0
3 190000 1
3 200000 0

CONTIUNED DEPENDS ON HOW MANY TICKETS ARE ALLOTED



FROM THIS TABLE QUERY IS




SELECT TOP N TICKETNO FROM TABLE WHERE STATUS=0


TOP N MAY CHANGE, SAY NOW 20

SELECT TOP 20 TICKETNO FROM TABLE WHERE STATUS=0


NOW THE RESUTL SET WILL BE


1 100000 0
1 120000 0
1 130000 0
1 140000 0
1 160000 0
1 180000 0
1 200000 0

2 100000 0
2 110000 0
2 140000 0
2 170000 0
2 180000 0
2 200000 0

3 100000 0
3 110000 0
3 120000 0
3 130000 0
3 140000 0
3 170000 0
3 180000 0



BUT I NEED THE RESULT SET AS

GROUP BY SERIES TICKETNO

11000 IS NOT AVAILABLE
SO

1 100000-100000
1 120000-140000

NOW 150000 IS NOT AVAILABLE

SO

1 160000-160000

BECAUSE 170000 IS NOT AVAILABLE

1 180000-180000

1 200000-200000



NOW THE SERIES CHANGES TO 2

2 100000-110000
2 140000-140000
2 170000-180000

sorry to say that question is not clear . Please be more precise in the requirement.
Apr 15 '08 #2
ck9663
2,878 Expert 2GB
As I recommended, you might need to resort to CURSOR

-- CK
Apr 15 '08 #3

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

Similar topics

0
by: user | last post by:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Lines: 105 Message-ID: <nlnBb.422437$0v4.20362698@bgtnsc04-news.ops.worldnet.att.net> Date: Tue, 09 Dec...
5
by: J. J. Cale | last post by:
Little astrology program has 2 text input boxes for birth dates. There are 3 selects for day month year that will supply output to whichever text input had the focus last. If the user picks from...
21
by: google | last post by:
I'm trying to implement something that would speed up data entry. I'd like to be able to take a string, and increment ONLY the right-most numerical characters by one. The type structure of the...
4
by: ypjofficial | last post by:
Hello All, To use sprintf function we have to first create a char * and assign some memory to it or we have to fixed memory sized array. eg. char str;//or it can be //char * str =(char...
18
by: Q. John Chen | last post by:
I have Vidation Controls First One: Simple exluce certain special characters: say no a or b or c in the string: * Second One: I required date be entered in "MM/DD/YYYY" format: //+4 How...
0
by: Mr Alphaque | last post by:
I got the problem doing the DES data encryption in Visual Basic, the result format i get is the 64-bit digits long in hexadecimal format. But what i customer wanted is the format result which...
2
by: rufpirat | last post by:
Hello I'm in the middle of trying to build an "AD phone book", and this being my first try at asp.net, I have a few questions that I hope some of you might be able to help with: 1. Is it...
1
by: donradii | last post by:
Hello all, I am new here and am new the world of javascripting. I am having a heck of a time trying to accomplish something that i conceptually know what i want to do but can not seem to get it...
9
by: pic078 via AccessMonster.com | last post by:
I need serious help - I have a frontend/backend Access database (2 MDE Files) that remains stuck in task manager after exiting the application - you can't reopen database after exiting as a result...
0
by: Hennie Coertze | last post by:
Good day, My knowledge of XML is next to none and I only have one XSL code to use. I also assume I may be using incorrect jargon and hope you will understand what I need. I have an XSL style...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.