Connecting Tech Pros Worldwide Help | Site Map

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

Alex
Guest
 
Posts: n/a
#1: Nov 12 '05
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...
Salad
Guest
 
Posts: n/a
#2: Nov 12 '05

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


Alex wrote:
[color=blue]
> 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...[/color]

Go to support.microsoft.com. They have a download called RptSmp97....lots
of sample queries.

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



Alan Webb
Guest
 
Posts: n/a
#3: Nov 12 '05

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


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" <oil@vinegar.com> wrote in message
news:404B601D.C3606483@vinegar.com...[color=blue]
> Alex wrote:
>[color=green]
> > 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...[/color]
>
> Go to support.microsoft.com. They have a download called RptSmp97....lots
> of sample queries.
>
> If you don't have an autonumber in the table with the From/To dates, add
> one.
>
>
>[/color]


Alan Webb
Guest
 
Posts: n/a
#4: Nov 12 '05

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


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" <gerald@yas1.freeserve.co.uk> wrote in message
news:b717bea0.0403070331.4f6c2d39@posting.google.c om...[color=blue]
> 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...[/color]


Closed Thread