Jump to content

Stano

Members
  • Content Count

    867
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by Stano

  1. Move the cursor to the appropriate word (eg sin) and wait a bit. A pop-up window will tell you in which unit it is located.
  2. Stano

    SQL

    So use it as a subselect.
  3. Stano

    SQL

    Using WITH. Somehow like this. If the unknown DB supports it WITH TB AS (SELECT EMPNO,EMPNAME, PRIORTAXBASE, BRUTSALARY, Case When SHAREHOLDER='Y' then (PRIORTAXBASE + BRUTSALARY) When RETIRED='Y' then (PRIORTAXBASE + BRUTSALARY)- ((PRIORTAXBASE + BRUTSALARY) * 4 /100) + When (SHAREHOLDER IS NULL or SHAREHOLDER='N') then (PRIORTAXBASE + BRUTSALARY) - ((PRIORTAXBASE + BRUTSALARY) * 0.18) end as TAXBASE ) SELECT Case When TAXBASE <= 30000 then TAXBASE * 20 When TAXBASE >30000 and TAXBASE <=50000 then TAXBASE * 30 .... end as TAXTOTAL FROM TB
  4. I agree. There is also a note that this can be canceled. My data has been around for a long time
  5. Stano

    Interbase Get Days count of a month

    For Firebird First Day of The Date: SELECT CAST(:DATA AS DATE) - EXTRACT(DAY FROM CAST(:DATA AS DATE)) + 1 FROM RDB$DATABASE LAST DAY OF THE DATE: SELECT CAST(:DATA AS DATE) - EXTRACT(DAY FROM CAST(:DATA AS DATE)) + 32 - EXTRACT(DAY FROM (CAST(:DATA AS DATE) - EXTRACT(DAY FROM CAST(:DATA AS DATE)) + 32)) FROM RDB$DATABASE
  6. OT: There is also "unwanted" optimization. My fresh case. Writing to JSON file. Item by item. For 86 items, it was over 7 seconds. It made me act. So I edited it and I write all the items at once. I realized that when I close the form, I go through it and write it to JSON. So he took advantage of the change, and had everything written down at once. I don't have to wait for the form to close at once. It's immediate In debug mode. I couldn't figure out why the forms were closing for so long.
  7. I'm trying to create a class that returns different types of components. Specifically, it is a TMS TDBxxSource for TDBPlanner. All are descendants of TDBItems. Use for example in SpinEdit, which would serve all TDBxxSource. There is a separate SpinEdit for each TDBxxSource. I only want one OnClick event for them. The class must return, according to the index, the specific TDBxxSource. Not TDBItems, because I would have to cast it in OnClick. This is nonsense. The class would lose its meaning. Example of use procedure TfrmPlannerRole.advsedDayScaleChange(Sender: TObject); var SpinEdit: TAdvSpinEdit; begin SpinEdit := TAdvSpinEdit(Sender); MyClass.DBSource(5).VariousTypes := SpinEdit.Value; end; Originally at https://forum.delphi.cz/index.php/topic,17355.0.html There is silence.
  8. I tried to do it. I had a problem that I always needed a different component. I solve it using case .. of. In a separate class.
  9. Even those who know Slovak did not understand I already have a solution. The topic is closed to me. Thank you all for your willingness to help me.
  10. I have several events that are identical in content. I only use a different component there every time. In the example, I have dbmlmnsrMultiMonth. And I want to use this event for other components that do the same thing. Only with another dbxxx. . So now I have 10 x SpineditxxxChange. And I want a single SpineditxxxChange event! Every time I need to get the right dbxxx component there.
  11. Stano

    Recursive S.Proc

    I'm just guessing that instead of Sum () you want to have the product AAA.QTY * AAA-1.QTY
  12. Well thank you. I was hoping to do it with some trick.
  13. MyClass - is my class I want to create DBSource - some method with parameter (AIndex: Integer). According to the parameter returns for example TSpinEdit, TPanel ...
  14. procedure TfrmPlannerRole.advsedDayScaleChange(Sender: TObject); var SpinEdit: TAdvSpinEdit; begin SpinEdit := TAdvSpinEdit(Sender); MyClass.DBSource(5).Top := SpinEdit.Value; // TPanel end; procedure TfrmPlannerRole.advsedDayScaleChange(Sender: TObject); var SpinEdit: TAdvSpinEdit; begin SpinEdit := TAdvSpinEdit(Sender); MyClass.DBSource(3).Value := SpinEdit.Value; // TSpinEdit end; Perhaps the examples will explain.
  15. I'm aware of that. Even that it always has to be only one kind / type! That's why I used the term "components" to indicate what I really want. It should always be returned to a different type.
  16. Stano

    Minor display issue

    I use a desktop with or without an MMX display. Quite often, MMX is displayed even if it is not to be. First image is OK, second is wrong. Win10 64, D 10.4.1
  17. Stano

    Minor display issue

    MMX window will appear in Design when using the "Copy Selected Component`s name fo Clipboard" button.
  18. Compilers generally try very hard if they find a bug. Then they don't know when to stop. D10.4 has made significant progress in this direction. The number of reported errors is several orders of magnitude lower. Even so, it is recommended to believe only the first mistake and ignore the others. I wouldn't make it a science.
  19. Stano

    Problem with clearing ADO Tables

    Could you give it a rest with the formatting? Your posts are hard enough to tolerate without it. Highlighting important parts is fine. Even pictures! But using a large font for almost the whole topic is no longer okay.
  20. Stano

    Problem with clearing ADO Tables

    I assume that reference integrity is defined in the DB. I think AV is the wrong term used. Each correct DB raises an exception, not an AV, in the event of an integrity violation, which must be handled. I know two basic ways to deal with emptying tables. 1. Empty tables from the lowest level to the next. In terms of referential integrity 2. Use DeleteCascade when defining reference integrity.
  21. Stano

    Customizing source editor

    For what? I use one scheme.
  22. Stano

    Problem with clearing ADO Tables

    I am convinced that tbl1660.Active: = true; and company is completely useless. If you need to update the table, use Refresh. But not where Adocommand is
  23. Stano

    Customizing source editor

    He probably has corrupted color vision.
×