Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2004
    Posts
    2

    Unanswered: Print the first character

    Is there anyway to print the first character of first name and first character of last name on the report but I have first name and last name in one field. e.g. Smith, Ann; I want to print S,A Is anyway to do it in Access report?

  2. #2
    Join Date
    Feb 2004
    Location
    CT,USA
    Posts
    250
    You need the left, "mid" & "instr" functions try something like:

    toPrint=Left([FullName],1) & Mid([FullName],Instr(1,[FullName]," ") +1, 1)

    That should do it.

  3. #3
    Join Date
    Jul 2004
    Posts
    2
    I did what you said but still not working. I'm using Access 97, is it make any different? I copied what I put in my qry on below.

    Expr2: Left([ [patient_listing]![NAME],1) & Mid([patient_listing]![NAME],InStr(1,[patient_listing]![NAME]," ")+1,1)

  4. #4
    Join Date
    Feb 2004
    Location
    CT,USA
    Posts
    250
    in your query Expr2 should have what you want, but if your looking in your report you must use variable "Expr2". What is not happening?

  5. #5
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    whazzat?

    Expr2: Left([ [patient_listing]![NAME],1) & Mid([patient_listing]![NAME],InStr(1,[patient_listing]![NAME]," ")+1,1)

    also use mid$() and left$() - they are faster than mid() and left() for string operations.

    izy
    currently using SS 2008R2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •