dbTalk Databases Forums  

Newbie Autonumbering Fields after sort.

comp.databases.filemaker comp.databases.filemaker


Discuss Newbie Autonumbering Fields after sort. in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Nando
 
Posts: n/a

Default Newbie Autonumbering Fields after sort. - 08-14-2005 , 09:10 PM






Hello,

I have a simple table that displays an Item Number (one item per
record) I also have a Date and a Time field. I want to create a script
that sorts the table by Date and Time, and then to automatically
renumber the Item Numbers based on this chronological sort. I may also
want to add (+) a value stored on a separate table to this series.

For example, on a separate table I have "Previous Number of Items"
amount ( a single number). Lets say the number is 120. After the sort,
I want the first record to be 121, then 122 and so on.

Also, I want to store on the separate table, the total number of
records in the Item table + the "Previous No. of Items". So basically,
what script do I use to count the total number of records in a given
table.

Many thanks for all the help!!

Reply With Quote
  #2  
Old   
Matt Wills
 
Posts: n/a

Default Re: Newbie Autonumbering Fields after sort. - 08-15-2005 , 04:17 AM






Nando wrote:

Quote:
Hello,

I have a simple table that displays an Item Number (one item per
record) I also have a Date and a Time field. I want to create a script
that sorts the table by Date and Time, and then to automatically
renumber the Item Numbers based on this chronological sort. I may also
want to add (+) a value stored on a separate table to this series.

For example, on a separate table I have "Previous Number of Items"
amount ( a single number). Lets say the number is 120. After the sort,
I want the first record to be 121, then 122 and so on.

Also, I want to store on the separate table, the total number of
records in the Item table + the "Previous No. of Items". So basically,
what script do I use to count the total number of records in a given
table.

Many thanks for all the help!!
Look at the Replace Field Contents script step.

Matt


Reply With Quote
  #3  
Old   
Matt Wills
 
Posts: n/a

Default Re: Newbie Autonumbering Fields after sort. - 08-15-2005 , 06:25 AM



Nando wrote:

Quote:
Hello,

I have a simple table that displays an Item Number (one item per
record) I also have a Date and a Time field. I want to create a script
that sorts the table by Date and Time, and then to automatically
renumber the Item Numbers based on this chronological sort. I may also
want to add (+) a value stored on a separate table to this series.

For example, on a separate table I have "Previous Number of Items"
amount ( a single number). Lets say the number is 120. After the sort,
I want the first record to be 121, then 122 and so on.

Also, I want to store on the separate table, the total number of
records in the Item table + the "Previous No. of Items". So basically,
what script do I use to count the total number of records in a given
table.

Many thanks for all the help!!
Answer to the second question:

Create a calc field using the Count function.

Matt


Reply With Quote
  #4  
Old   
Quite Curious
 
Posts: n/a

Default Re: Newbie Autonumbering Fields after sort. - 08-15-2005 , 11:23 AM



Thank you Matt, but I think this will only replace the field only in
the current record. I need the script to cycle thru all the records
after the chronological sort.

Thanks again,
Nando




On Mon, 15 Aug 2005 09:17:31 GMT, "Matt Wills" <I'm (AT) Witz (DOT) end> wrote:

Quote:
Nando wrote:

Hello,

I have a simple table that displays an Item Number (one item per
record) I also have a Date and a Time field. I want to create a script
that sorts the table by Date and Time, and then to automatically
renumber the Item Numbers based on this chronological sort. I may also
want to add (+) a value stored on a separate table to this series.

For example, on a separate table I have "Previous Number of Items"
amount ( a single number). Lets say the number is 120. After the sort,
I want the first record to be 121, then 122 and so on.

Also, I want to store on the separate table, the total number of
records in the Item table + the "Previous No. of Items". So basically,
what script do I use to count the total number of records in a given
table.

Many thanks for all the help!!

Look at the Replace Field Contents script step.

Matt


Reply With Quote
  #5  
Old   
Remi-Noel Menegaux
 
Posts: n/a

Default Re: Newbie Autonumbering Fields after sort. - 08-15-2005 , 11:53 AM



That's what the 'Replace' function is there for.
You should read the Help.
Remi-Noel


"Quite Curious" <not (AT) home (DOT) com> a écrit dans le message de news:
78g1g15jmifna78680u57lono8sqbhkp2h (AT) 4ax (DOT) com...
Quote:
Thank you Matt, but I think this will only replace the field only in
the current record. I need the script to cycle thru all the records
after the chronological sort.

Thanks again,
Nando




On Mon, 15 Aug 2005 09:17:31 GMT, "Matt Wills" <I'm (AT) Witz (DOT) end> wrote:

Nando wrote:

Hello,

I have a simple table that displays an Item Number (one item per
record) I also have a Date and a Time field. I want to create a
script
that sorts the table by Date and Time, and then to automatically
renumber the Item Numbers based on this chronological sort. I may
also
want to add (+) a value stored on a separate table to this series.

For example, on a separate table I have "Previous Number of Items"
amount ( a single number). Lets say the number is 120. After the
sort,
I want the first record to be 121, then 122 and so on.

Also, I want to store on the separate table, the total number of
records in the Item table + the "Previous No. of Items". So
basically,
what script do I use to count the total number of records in a given
table.

Many thanks for all the help!!

Look at the Replace Field Contents script step.

Matt




Reply With Quote
  #6  
Old   
Matt Wills
 
Posts: n/a

Default Re: Newbie Autonumbering Fields after sort. - 08-15-2005 , 06:21 PM



Replace Field Contents performs the replacement on the specified field in
all records in the found set.

In fact, FM Help specifically mentions what you want to do as one of the
possible uses for the step:

"This step can also be used to reserialize a field in every record in the
current found set."

Matt

Quite Curious wrote:

Quote:
Thank you Matt, but I think this will only replace the field only in
the current record. I need the script to cycle thru all the records
after the chronological sort.

Thanks again,
Nando




On Mon, 15 Aug 2005 09:17:31 GMT, "Matt Wills" <I'm (AT) Witz (DOT) end> wrote:

Nando wrote:

Hello,

I have a simple table that displays an Item Number (one item per
record) I also have a Date and a Time field. I want to create a script
that sorts the table by Date and Time, and then to automatically
renumber the Item Numbers based on this chronological sort. I may also
want to add (+) a value stored on a separate table to this series.

For example, on a separate table I have "Previous Number of Items"
amount ( a single number). Lets say the number is 120. After the sort,
I want the first record to be 121, then 122 and so on.

Also, I want to store on the separate table, the total number of
records in the Item table + the "Previous No. of Items". So basically,
what script do I use to count the total number of records in a given
table.

Many thanks for all the help!!

Look at the Replace Field Contents script step.

Matt


Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.