473,566 Members | 2,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

adding Unique ref number to each row in a query??

Acc 97

Hi, I am in need of some help here....
I have a query which is based upon time, where i need to plot the
hours
a job has been working.. therefore, oN & off in a union query.

problem...

the same time-frame is used, ie..

on off
12:00 14:00
12:00 14:00
12:00 15:00
12:10 15:00
2 questions!

I need to add a unique number to my query, to make a running sum work!
which must be able to run independently while also within data block.
(Ie have the ability to re-set to zero over one defined datablock)
1) how can this be done?

2) Can any one show me how I influence the next number in the
preceeding row? say,.. increase it by a factor of 1, which would then
give me my unique number.

or there maybe other options which elude me...
Thanks...
Nov 12 '05 #1
3 5733
Alex wrote:
Acc 97

Hi, I am in need of some help here....

I have a query which is based upon time, where i need to plot the
hours
a job has been working.. therefore, oN & off in a union query.

problem...

the same time-frame is used, ie..

on off
12:00 14:00
12:00 14:00
12:00 15:00
12:10 15:00

2 questions!

I need to add a unique number to my query, to make a running sum work!
which must be able to run independently while also within data block.
(Ie have the ability to re-set to zero over one defined datablock)

1) how can this be done?

2) Can any one show me how I influence the next number in the
preceeding row? say,.. increase it by a factor of 1, which would then
give me my unique number.

or there maybe other options which elude me...

Thanks...


Go to support.microso ft.com. They have a download called RptSmp97....lot s
of sample queries.

If you don't have an autonumber in the table with the From/To dates, add
one.

Nov 12 '05 #2
Salad,
Running totals are a supported feature of Access reports. I am not aware of
the ability to do a running total in SQL, though. Simplest solution would
be a bound report with your running total in there.

"Salad" <oi*@vinegar.co m> wrote in message
news:40******** *******@vinegar .com...
Alex wrote:
Acc 97

Hi, I am in need of some help here....

I have a query which is based upon time, where i need to plot the
hours
a job has been working.. therefore, oN & off in a union query.

problem...

the same time-frame is used, ie..

on off
12:00 14:00
12:00 14:00
12:00 15:00
12:10 15:00

2 questions!

I need to add a unique number to my query, to make a running sum work!
which must be able to run independently while also within data block.
(Ie have the ability to re-set to zero over one defined datablock)

1) how can this be done?

2) Can any one show me how I influence the next number in the
preceeding row? say,.. increase it by a factor of 1, which would then
give me my unique number.

or there maybe other options which elude me...

Thanks...


Go to support.microso ft.com. They have a download called RptSmp97....lot s
of sample queries.

If you don't have an autonumber in the table with the From/To dates, add
one.

Nov 12 '05 #3
Alex,
I have another reply. I've posted this before so a search of Google might
turn up that previous post. Autonumber works great as long as you need a
number that is created with the record and doesn't change. If you have a
need for a custom sequence number that changes with each report run the best
way I am aware of is a stored procedure that increments a number stored in a
column in a table and returns the incremented number.

"Alex" <ge****@yas1.fr eeserve.co.uk> wrote in message
news:b7******** *************** ***@posting.goo gle.com...
Acc 97

Hi, I am in need of some help here....
I have a query which is based upon time, where i need to plot the
hours
a job has been working.. therefore, oN & off in a union query.

problem...

the same time-frame is used, ie..

on off
12:00 14:00
12:00 14:00
12:00 15:00
12:10 15:00
2 questions!

I need to add a unique number to my query, to make a running sum work!
which must be able to run independently while also within data block.
(Ie have the ability to re-set to zero over one defined datablock)
1) how can this be done?

2) Can any one show me how I influence the next number in the
preceeding row? say,.. increase it by a factor of 1, which would then
give me my unique number.

or there maybe other options which elude me...
Thanks...

Nov 12 '05 #4

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

Similar topics

3
1923
by: David Berry | last post by:
Hi All. I'm trying to write an ASP page that shows me the UNIQUE account number for a customer (so I can pass it to another page) based on a search criteria. For example, I want to do a select statement on the customer table and orders table (joining on the ACCTNO) for all "Video" products. Ex: sq = "SELECT CUSTOMER.ACCTNO, CUSTOMER.NAME...
1
2631
by: Bryan Zash | last post by:
When querying a bit field, I am encountering a problem with MS SQL Server returning a larger number of records for a table than the actual number of records that exist within that table. For example, my customer table has 1 million unique records, so the results of the following query are as such: select count(customer_nbr) from customer...
2
7809
by: SJM | last post by:
I have a report that displays records of real estate properties. It is possible for each property to appear a number of times for various reasons. Each record however is unique. What I would like to do is display the total of the number of unique properties in the report footer, not just a count of the number of records. I have experimented...
1
2829
by: tHeRoBeRtMiTcHeLL | last post by:
Below is an earlier post to an Excel Group.. ....but I thought that there might be a way to do this in Access by importing data and then creating append and/or update query. I would most certainly need to use the right type of table join and criteria in the query to perform the task, and don't find myself an expert or up to par as far as I'm...
16
2460
by: Geoff Jones | last post by:
Hi Can anybody help me with the following, hopefully simple, question? I have a table which I've connected to a dataset. I wish to add a new column to the beginning of the table and to fill it with incremental values e.g. if the tables looks like this: 23 56
9
3101
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to be inserted into a standard web address in the table (the filed name is link) in ddw1 Example address ---
10
2783
by: mscurto | last post by:
What is the syntax for an sql command to get the following. I want to pull in a handful of fields from a table but one of the fields needs to be unique. For example, if I have a customer table and I want to get each unique customer number but I also want to get the customer's name, address, email address, etc. What is the syntax? I am...
8
7194
by: Marc | last post by:
Hi all, I have to generate and send to a printer many 6 digit alphanumeric strings. they have to be unique but I cannot check in a database or something like that if it have already been printed. the string has also to seem a random one and it cannot have an apparence of a sequence. My first approach is to do it with a decimal counter and...
2
4440
by: srusskinyon | last post by:
I need some help getting unique records from our database! I work for a small non-profit homeless shelter. We keep track of guest information as well as what services we have offered for statistical purposes. I've been using Here's the situation: I have two main tables:
0
7584
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7888
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
8108
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...
1
7644
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...
0
7951
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
6260
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
5484
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
5213
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
3626
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.