Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 08:25 PM
Alex
Guest
 
Posts: n/a
Default 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...

  #2  
Old November 12th, 2005, 08:26 PM
Salad
Guest
 
Posts: n/a
Default 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.



  #3  
Old November 12th, 2005, 08:26 PM
Alan Webb
Guest
 
Posts: n/a
Default 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]


  #4  
Old November 12th, 2005, 08:26 PM
Alan Webb
Guest
 
Posts: n/a
Default 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]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.