Jump to content

Henry Olive

Members
  • Content Count

    216
  • Joined

  • Last visited

Everything posted by Henry Olive

  1. Good Day, MyQuery Result is like below TotalCost...TotalCostWıthExp 100 110 Is it possible something like below function function.GetBomCosts (ItemCode:String): Value1,Value2 : Double Thank You
  2. Henry Olive

    Function with 2 return values ?

    Thank You So Much Serge, Cristian, Uwe, David, Andrea, Frost.Brutal, Stefan, Leif, Bill, Gustav
  3. Henry Olive

    ClientDataSet Locate

    Good Day, Delphi 10.3 My Table looks like below ID ABC-0001 ABC-0002 ABC-0003 Is there a way to Locate a record just with last characters For Example SearchText := '0002' CDS1.Locate ('ID', QuotedStr(SearchText), [LoPartialKey]); Above Locate code doesnt works ! Thank You
  4. Henry Olive

    ClientDataSet Locate

    Thank You Lajos
  5. Henry Olive

    FB3 Update

    Good Day, I want to Update a target table according to a Master Detail table records. I wrote 2 Stored Procs. 1 for Update a Single record in target , the other for Update All records in target Here below my 2 s.procs, both works, but i'd like to be sure and need an expert confirmation Could someone please help.? /* For single 1 record update s.proc */ ALTER PROCEDURE UPDATEACC_SINGLE ( ACCCODE VARCHAR(20), ACTIVEYEAR VARCHAR(4) ) AS BEGIN IF (ACCCODE IS NULL) THEN EXIT; UPDATE ACCACCOUNT SET DEBIT= (SELECT SUM(AD.DEBIT) FROM ACCRECDETAIL AD JOIN ACCRECEIPT AR ON AD.RNO=AR.RNO WHERE AD.ACCCODE=:ACCCODE and EXTRACT(YEAR FROM AR.TDATE)=:ACTIVEYEAR), CREDIT= (SELECT SUM(AD.CREDIT) FROM ACCRECDETAIL AD JOIN ACCRECEIPT AR ON AD.RNO=AR.RNO WHERE AD.ACCCODE=:ACCCODE and EXTRACT(YEAR FROM AR.TDATE)=:ACTIVEYEAR); END /* For all records update s.proc */ ALTER PROCEDURE UPDATEACC_ALL ( ACTIVEYEAR VARCHAR(4) ) AS begin UPDATE ACCACCOUNT AC SET AC.DEBIT=(SELECT SUM(AD.DEBIT) FROM ACCRECDETAIL AD JOIN ACCRECEIPT AR ON AR.RNO=AD.RNO WHERE AR.RNO=AD.RNO and AD.ACCCODE=AC.ACCCODE and EXTRACT(YEAR FROM AR.TDATE)=:ACTIVEYEAR), AC.CREDIT=(SELECT SUM(AD.CREDIT) FROM ACCRECDETAIL AD JOIN ACCRECEIPT AR ON AR.RNO=AD.RNO WHERE AR.RNO=AD.RNO and AD.ACCCODE=AC.ACCCODE and EXTRACT(YEAR FROM AR.TDATE)=:ACTIVEYEAR); end Thank You
  6. Henry Olive

    FB3 Update

    Thank you so much tgbs
  7. Henry Olive

    FB3 Update

    Thank you SO SO SO much Serge Your code is shorter & faster
  8. Henry Olive

    FB3 Update

    Thank you So Much Serge What you mean by ACCACCOUNT table description ? ACCAccount table is like below ACCCODE, DEBIT, CREDIT
  9. Henry Olive

    Delphi10.3 - FB3 - Firedac BackUp

    Good Morning, I use FireDac BackUp component w/o any problem but, When i backup my data ( 3MB ) my backup file is also 3MB I asked this question a couple of months ago here Mr.Serge replied me (Thank you again) and said it is normal. Yesterday this situation came to my mind & researched in google but i couldnt find any information then i checked Delphi 10.3 sample projects and found a FireDac Samples project included BackUp, Restore components I tested to backup my project in sample firedac backup project and i noticed the backup file's size is nearly 1MB (1/3 of the original data which i expected) then i compared sample project and Delphi 10.3 component pallet's BackUp components i noticed they are different, for example 1- Sample project's backup component doesnt has DIRECT property but Delphi 10.3 has 2- Sample project's backup component's Option is totally different then Delphi 10.3 I tried to change DIRECT property value to Off ( Originally it was ndDefault ) and i tried a new backup this time my backup file is nearly 1,5MB ( 1/2 of the original data ) I'm confused. Could someone please help me What is DIRECT property & what does they mean (nbDefault, On, Off ) Thank You
  10. Henry Olive

    Split String

    Good Day, MyCode in Database = VARCHAR(20) MyCode could be (120 or 250) like 3 digit Integer, or (200.001 or 600.010) there is a dot between numbers, or (500.005.0010 or 100.010.1500) there are 2 dots between numbers I need to Increase MyCode by 1 that is if MyCode = 100 then requested result = 101 if MyCode = 300.001 then requested result = 300.002 if MyCode = 600.005.0010 then requested result = 600.005.0011 How can i do that ? Thank You
  11. Henry Olive

    Split String

    Thank you SO MUCH Serge
  12. Henry Olive

    Split String

    Thank You Sherlock, SwiftExpat Thank You SO MUCH Peter
  13. Henry Olive

    FB-3 SELECT WHERE

    Good Day, My Table : ID...TNAME..TDATE................INVNO 1......AA...........01/06/2022 2......BB............01/06/2022.........22 3......AA...........02/06/2022.........33 4......AA...........10/06/2022.........44 Requested Result : ID....TNAME.....TDATE..................INVNO 1........AA.............01/06/2022 4........AA............10/06/2022..........44 Lets say today = 13/06/2022 (dd/mm/yyy) and i want to show TNAME='AA' and INVNO IS NULL (Whatever TDATE is ) **or** INVNO IS NOT NULL but TDATE >= 03/06/2022 ( All 10 Days old records ) My Sql : SELECT * FROM MYTABLE WHERE TNAME IN ('AA') and (TDATE >= (SELECT MAX(TDATE) FROM MYTABLE ) - 10 or (X.INVRNO IS NULL)) with above Sql i dont see ID=4 record (Its INVNO is not null BUT Its Date is just 3 days old, that is i should see it ) Thank You
  14. Henry Olive

    FB-3 SELECT WHERE

    Thank you SO MUCH Stano, Serge, Pat
  15. Henry Olive

    FB-3 Get Connected Clients IP Numbers

    Good Day, FB-3,09 Super Server Delphi 10,3 TCP/IP FB FAQ says, If you wish to do it from SQL, you need to use Firebird 2.1 at least, and it's monitoring tables. The relevant table is MON$ATTACHMENTS which provides a lot of useful information like user name, IP address, connection state, remote process name (so you can see which application user is using), etc. then i tried below Sql but i cant see any IP Adress select MON$REMOTE_ADDRESS from MON$ATTACHMENTS Above query's result is like below ( No IP Number ) MON$REMOTE_ADDRESS --------------------------------------- fe80::2554:878:750b:852f%5/50222 fe80::9037:f453:60b:b6b9%5/52029 Thank You
  16. Henry Olive

    FB-3 Get Connected Clients IP Numbers

    Thank You SO MUCH Serge, for very useful informations
  17. Henry Olive

    Vcl to Fmx

    I wish everyone a healthy day I'm planning to start a Fmx database app. ( i already have a database Vcl app., i'll just convert it to Fmx) I saw there are 2 grids (Grid,String Grid) in Fmx, which one should i use instead of my vcl dbgrid ? Also is there any advice information anywhere in web regarding from Vcl to Fmx ? Thank You
  18. Henry Olive

    FB-3 Get Connected Clients IP Numbers

    Thank you so much Vandrovnik In server machine Ethernet Proporties both TCP/IPv4 and TCP/IPv6 CHECKED If i uncheck TCP/IPv6 ( Just TCP/IPv4 checked ) then i cannot connect My App (Rejected Remote Interface error)
  19. Henry Olive

    FB3 - FDBackUp

    Good Day, Is a backup operation with FDBackUp safe during all users use the program ? Also when i backup with FDBackUp, BackUp File's size same as actual database Is that normal ( No compress ) ? Thank You
  20. Henry Olive

    FB3 - FDBackUp

    Good Morning Serge, Thank you so much
  21. Henry Olive

    ExtractFileDir

    Good Day, My Program Folder = 'C:\MyApp\Data\MyData.FBD' // if it is LOCAL else it is \\Mysrv\c\MyApp My Exe File is in 'C:\MyApp' (Local) or \\Mysrv\c\MyApp I know how can i get ExeFolder which is C:\MyApp or \\Mysrv\c\MyApp but I Just need to get **MyApp** part of the folder w/o C:\ or \\Mysrv\c\ How can get it ? Thank You
  22. Henry Olive

    ExtractFileDir

    Thank you SO MUCH Uwe
  23. Henry Olive

    Time Between

    Good Day, procedure TDm.BackUpTimerTimer(Sender: TObject); var MyTime, BackUpStart,BackUpEnd : TTime; begin MyTime := Now; BackUpStart := dm.SettingBACKUPHOUR.AsDateTime; // which is 20:30 BackUpEnd := BackUpStart + EncodeTime(0,30,0,0); // which is 21:00 if ((MyTime >= BackUpStart) and (MyTime <= BackUpEnd)) then // this code doesnt work BackUp; end; Can somebody please help Thank You
  24. Henry Olive

    Time Between

    I changed MyTime to TTime and now my code works. Thank You SO MUCH Mark, Uwe
  25. Henry Olive

    Time Between

    Eventhough the time is between 20:30 21:00 below code doesnt work if ((MyTime >= BackUpStart) and (MyTime <= BackUpEnd)) then i check MyTime, BackUpStart, BackUpEnd all of them are correct when debugging if ((MyTime >= BackUpStart) then // this works but both with BackUpEnd doesnt work
×