How to Use the Replace Function in Microsoft Access

Поделиться
HTML-код
  • Опубликовано: 15 сен 2024

Комментарии • 23

  • @jillybeanc
    @jillybeanc 4 месяца назад +1

    Question. I have a Table that includes 7 columns for the days of the week. The table data is pulled from a report where it just shows a "Y" in that days column if the course (I work at a school) is taking place on that day. Is there a way to have it change to the letter of the day instead. For instance, if a course is taking place on Mondays, I would like to have an M show instead of a Y when I run that query. I have built separate tables for each day to look for a Y and replace it with a letter but that's 7 different tables that I have to connect every time and I know there has to be an easier way. Any help would be awesome.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  4 месяца назад

      It sounds like you have 7 columns where the field names are Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday. Courses are in rows. If a course happens on that day, it has "Y" in the field, but you want to show the first character of the day instead.
      You can solve this using the function called iif()
      You can use iif for each column in your query. Your query design might have an expression:
      CourseMonday: iif([Monday]="Y", "M", "")
      then,
      CourseTuesday: iif([Tuesday]="Y", "T", "")
      etc.
      One query only 🛠
      How to use iif: ruclips.net/video/tGfebrGlnHY/видео.html

  • @manishkashikar9154
    @manishkashikar9154 Год назад +1

    wow wonderful information

  • @garythedo
    @garythedo 2 года назад +1

    Hi, really great videos! I was wondering if you might do one in the future on the SelStart property to move the cursor to a particular spot in a text box string and then add new (or replace text) at that location?

  • @nycbklynrmp
    @nycbklynrmp Год назад +1

    had an issue, if use replace with group and contion succh as like
    eg reason for visit *well care*, *well visit,* wcv * were strings to find in text
    however wanted to replace ‘swell’ to ‘’nothing because I don’t want to match on swell, or swelling
    in query design
    replace(x, “swell”, “”)
    group
    critreria : like *well care*

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  Год назад

      You don't need the Replace function here I think (unless you're changing data). If you don't want to also capture swell or swelling then you can search Select * From MyTable Where TextField Like "well %" Or TextField Like "% well %"
      The first condition will find those with entries starting with "well". The second condition will find entries with " well " as a whole word in the entry. No swell or swelling. Note the spaces! Replace % with * if you need to. YT wants to format this comment using stars :-D

  • @dbdata9836
    @dbdata9836 2 года назад +1

    thanks

  • @user-gw5nr1oc1h
    @user-gw5nr1oc1h Год назад +1

    Would have preferred to see the VBA code so I can turn this into a function

  • @mukeshmishra1639
    @mukeshmishra1639 2 года назад +1

    How to insert automatic text from drop-down when I edit or modified or update in any row

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 года назад

      You could do this using After Update and After Insert on your Form. Put some VBA in there to insert the text.

    • @mukeshmishra1639
      @mukeshmishra1639 2 года назад

      Sir can you provide me VBA code please

  • @dbdata9836
    @dbdata9836 2 года назад +1

    great

  • @mukeshmishra1639
    @mukeshmishra1639 2 года назад +1

    How to control duplicate data in two fields in ms access form