Results 1 to 4 of 4
  1. #1
    webzavi is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2017
    Posts
    2

    Adding Unique Incremental Number to a String in Database Field

    I'm working on an old CMS for a client. The CMS is software based. All the website content is on the customers Computer and gets published to web as static pages on upload.




    The CMS is using MS Access 2000 database. There's a table called Products and there's a field called product-page that stores the names of all the product pages for all the products.


    The issue I have is not all product pages are unique and there are over 15,000 products stored in the Database.


    I'm looking to make all the product pages unique by adding a unique number to each product pages. Is there a simple away to do this using SQL in MS Access 2016?


    i.e. product-page-name.html becomes product-page-name1.html, product-page-name2.html etc


    I could easily go into Excel and do this, but due to the volume of products I can't past the column back into the Database so I need SQL to do this for me.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    just add a new field PRODID as AUTONUMBER. Save table. It will create unique id for every record.

  3. #3
    webzavi is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2017
    Posts
    2
    Sadly because of how the Database is connected to the CMS Software I can only adjust the one field. It's a one off process. I just need to tidy up field with the data in it in one go

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    It sounds like you just want to rename each of the html pages.

    Is this before the html page is created? Or while the page is being generated?

    You should be able to do this in VBA......

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 11
    Last Post: 11-11-2014, 06:04 PM
  2. querying on a number field using a string
    By George in forum Modules
    Replies: 3
    Last Post: 10-30-2014, 08:33 AM
  3. Calculated field to change a string to a number
    By Cyberwombat in forum Database Design
    Replies: 2
    Last Post: 01-09-2014, 02:48 PM
  4. Incremental Number in a Query
    By jmauldin01 in forum Access
    Replies: 5
    Last Post: 01-01-2014, 01:23 AM
  5. Replies: 2
    Last Post: 06-01-2013, 07:00 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums