Databases in Delphi - Filter

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ม.ค. 2025

ความคิดเห็น • 17

  • @jerbear197
    @jerbear197 5 ปีที่แล้ว +2

    How would you use the one filter procedure to filter a text field ignoring case, and the same filter to filer on a >= on a numeric field..
    I used a combobox to allow user to selct a field to filter on and a memo to allow the user to enter the filter string.
    I can get it to work for either one but have to change the code to do so. I'd like it to work for both, or am I going to have to write procedures for
    different filter types..
    SelectedField := cbFilterField.Value;
    tblUser.Filtered := False;
    ShowMessage('FILTER : '+SelectedField+' '+FilterMemo.Text);
    tblUser.Filter := SelectedField+' '+FilterMemo.Text;
    tblUser.Filtered := True;
    This will work for SelectedField >= 100 but not on a text field.
    I Tried to use this by typing in the memo field QuotedStr(FullName)
    Had to modify this line to .... tblUser.Filter := SelectedField+' = '+QuotedStr(FilterMemo.Text);

  • @MrCraigster123
    @MrCraigster123 7 ปีที่แล้ว +20

    Ur gonna be the reason I pass grade 12😂😂

  • @sidali_informatique
    @sidali_informatique 5 ปีที่แล้ว

    if u write muse never you see result
    how to filter a table by respecting uppercase and lowercase in delphi

  • @gertdupreez6273
    @gertdupreez6273 5 ปีที่แล้ว

    I have a delema. In my PAT I have key words for articles in a database and the title,author and date in another. I have combo boxes that contains all the keywords available but I dont know how to code to let people choose a keyword that is in one database and display the title and date and author that is in another, in a DBGrid can you please help me?

    • @lilanelegrange789
      @lilanelegrange789 5 ปีที่แล้ว

      Start with a while loop with your keywords looping through that table with an if statement searching for the keywords. Inside that loop you have a nested loop looping through the other table. In an if statement find the field through which you are linking the tables through and display the tile, date and author inside the if.

    • @lilanelegrange789
      @lilanelegrange789 5 ปีที่แล้ว

      @Courtney Fanner That usually means where you are displaying the fields in the RichEdit one or more of them has a number data type and you need to add FloatToStr / IntToStr. FloatToStrF(tblXX['FieldName']) or IntTostr(tblXX['FieldName']). Same could happen with boolean fields

  • @dillonward9033
    @dillonward9033 3 ปีที่แล้ว

    how to we delete the records but still keep the IDs in the correct order

    • @MrLongITandCAT
      @MrLongITandCAT  3 ปีที่แล้ว

      You can sort by the ID field using code:
      Example:
      tblUser.Sort := 'UserID ASC' ;

  • @mofoundolacedric1202
    @mofoundolacedric1202 2 ปีที่แล้ว

    hello sir please could you help me solve this problem, I would like to do a filter:
    on the list of Algerian consumables
    and the list of items with a higher purchase price than a given price
    thank you in advance

    • @MrLongITandCAT
      @MrLongITandCAT  2 ปีที่แล้ว

      Can you you tell me what the field names are and what data types the fields are?

    • @mofoundolacedric1202
      @mofoundolacedric1202 2 ปีที่แล้ว +1

      @@MrLongITandCAT hello sir, thank you for your reaction, I have already found the solution to my problem

  • @cameron_blackwell_
    @cameron_blackwell_ 5 ปีที่แล้ว +2

    I have a feeling that you really like the artist Muse 😂

  • @أحمدزوايد-ل5د
    @أحمدزوايد-ل5د 5 ปีที่แล้ว +1

    thanks

  • @redobona470
    @redobona470 2 ปีที่แล้ว

    Спасибо от души просто я тебя люблю