Page 3 of 3 FirstFirst 123
Results 31 to 38 of 38
  1. #31
    Mathurin is offline Novice
    Windows 11 Access 2019
    Join Date
    Nov 2024
    Posts
    20

    Bonjour,

    J'ai crée la colonne D avec des dates en format texte court et la creation de la colonne SD avec la formule suivante: SD: Left(D,4) & "/" & Mid(D,5,2) & "/" & Right(D,2) J'ai recu le message : La syntaxte de l'expression entrée n'est pas valide. Quel est le probleme ?

    Merci de votre aide

  2. #32
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,927
    because the underlying value is a number, not text. What you are seeing is a format.

    Type this into the vba immediate window

    ?cdbl(date())


    and it returns a number - today (12th December 2024) returns 45638

    And to include a time element, use the now function (time is 22:45)

    ?cdbl(now())

    returns this 45638.9483101852

    So if you want to use your formula you need to first convert the number to text using the format function (not property)


    Also have to question your formula - the first part returns the first 4 characters and would have thought it should be the last 4 characters - but perhaps you have a weird date format? No example data provided or outcome required and I'm not going to waste time guessing

  3. #33
    Mathurin is offline Novice
    Windows 11 Access 2019
    Join Date
    Nov 2024
    Posts
    20
    Bonjour

    Pour les quatre premier caracteres je me suis basé sur le video sur youtube qui était inscrit de cette facon et cette formule. Dans ma base de donnée les dates sont inscrite jj-mm-aaaa dans la colonne MARR_DATE de la table Listeind et sont texte court, que je veux transformer en date. J'ai tenté de copier la prise d'écran dans la réponse mais le logiciel du forum me retourne le message de trop volumineux.

  4. #34
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,927
    in my database, the dates are written as dd-mm-yyyy in the MARR_DATE column of the Listeind table and are short text
    see post #29

  5. #35
    Mathurin is offline Novice
    Windows 11 Access 2019
    Join Date
    Nov 2024
    Posts
    20
    Bonjour Dave, J'ai fait tout les changements, cela fonctionne.j'ai deplacé la colonne ID_IND vers la premiere colonne et impossible d'inscrire cle premiere. un message de risque de doublons pourtant tos des chiffres différents de 1 a 32125. C'est quoi le probleme ?

  6. #36
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2021
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,739
    You have mentioned MARR_DATE and ID_IND in your posts, but these columns don't exist in the original imported Excel file. As for the ID_IND, if that is the Excel column named ID_INDIVIDU, the column does have duplicates. If you want this column to be the primary key, it will not be possible with existing duplicates. Furthermore, you already have a primary autonumber key named ID.
    What are you trying to accomplish with ID_IND and where did it come from?

    We are not mind readers and cannot see your database file and it seems to be quite different from the original Excel file.

  7. #37
    Mathurin is offline Novice
    Windows 11 Access 2019
    Join Date
    Nov 2024
    Posts
    20
    Bonjour,

    Je ne savais pas que les fichiers Access restaient relié avec ceux de Excel. Je vais refa0ire mes devoirs. Merci

  8. #38
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2021
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,739
    Quote Originally Posted by Mathurin View Post
    Hello,

    I didn't know that Access files were still linked to those of Excel. I am going to do my homework again. Thank you
    You have the choice of linking an Excel spreadsheet to Access and use it like a table, or actually importing the spreadsheet into an Access table.
    If the latter, then the Excel spreadsheet is separate from the Access database after the import.
    I think you are importing the Excel into Access, not linking it. The advantage is that you have more control over the file if it is an internal table rather than an external spreadsheet.

    My thinking in post #36 is that you have modified the the Access table after the Excel import or that you have imported a different Excel file from your example provided in post #13.

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access 2003: import csv fails as csv is still open
    By vanthien in forum Import/Export Data
    Replies: 3
    Last Post: 01-06-2013, 07:46 PM
  2. SendObject Export CSV and Import CSV
    By DetrieZ in forum Import/Export Data
    Replies: 2
    Last Post: 09-19-2012, 04:52 PM
  3. Macro To Import CSV to ACCESS
    By csvivek in forum Import/Export Data
    Replies: 1
    Last Post: 12-07-2009, 01:49 PM
  4. Importing Xls and CSV files into MS Access
    By Jeff in forum Import/Export Data
    Replies: 1
    Last Post: 02-17-2009, 11:56 PM
  5. CSV File Import
    By compasst in forum Import/Export Data
    Replies: 3
    Last Post: 03-31-2006, 09:37 AM

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