Update query

E

Ellen

Hello,
I'd like to create a new number field from a "endnote" field.

The endnote field has entries such as "Endnote 1" and "Endnote 2". I'd like
the new field to contain the endnote number only, so where the endnote field
entry is "Endnote 1" the corresponding new field entry would be "1".

Thanks in advance for your help,
Ellen
 
S

Sprinks

Hi, Ellen.

Add your new numeric field in table design view, then in your update query,
pull the end of the string starting with the 9th character, then convert it
to a number:

= Val(Mid([Endnote], 9, len([Endnote])-8)

Hope that helps.
Sprinks
 
E

Ellen

Thanks, Sprinks. Your code worked beautifully! Now I can sort the endnotes
correctly. It was sorting them like text.

Sprinks said:
Hi, Ellen.

Add your new numeric field in table design view, then in your update query,
pull the end of the string starting with the 9th character, then convert it
to a number:

= Val(Mid([Endnote], 9, len([Endnote])-8)

Hope that helps.
Sprinks

Ellen said:
Hello,
I'd like to create a new number field from a "endnote" field.

The endnote field has entries such as "Endnote 1" and "Endnote 2". I'd like
the new field to contain the endnote number only, so where the endnote field
entry is "Endnote 1" the corresponding new field entry would be "1".

Thanks in advance for your help,
Ellen
 
Top