Henry Olive
Members-
Content Count
284 -
Joined
-
Last visited
Everything posted by Henry Olive
-
Good Day, I have a StringList like below (total 4 rows) ITEMCODE...QTY 01-01.............10 (This Row is Empty) 01-02.............30 aaa I'd like to get JUST correct ITEMCODEs (According to my ITEMS table records) For example in above grid Empty Row and aaa dont available in ITEMS table so i want to skip them I only need '01-01' and '01-02' My Code is like below for i := 0 to SGrid1RowCount-1 do begin ItemNoCol:=SpinEditItemNo.Value; ItemNo:=SGrid1.Cells[ItemNoCol,i+2]; SQLDataset.Close; SQLDataset.CommandText :='SELECT ITEMCODE FROM ITEMS WHERE ITEMCODE='+QuotedStr(ItemNo); SQLDataset.Open; if (ItemNo='') or (SQLDataset.Fields[0].asString='') then ........ // I need a code here like Skip the row and go to next row else ...... ......... end; Thank You
-
How can i get First Business Day Of Next Month ? ( Saturday & Sunday are not Business days.) For example in February Next business day of next month is March-01 In May Next business day of next month is June-03 Thank You
-
First Business Day Of Next Month ?
Henry Olive replied to Henry Olive's topic in RTL and Delphi Object Pascal
Thank you so much Lars, Uwe You both are right, Is there a way to consider also local bank holidays ? Thank You -
Good Day Delphi10, FB-3, SQLDataset, DataSetProvider, CDS, DataSource MasterTable TNAME Field.Value = 'A.Cap-' // There is - at the end When I insert a new record into the DetailTable my code is like below DetailTable.FieldByName('TNAME').asString := MasterTable.FieldByName('TNAME').asString; After Post & ApplyUpdate when i check releated record in the Database i see TNAME value in DetailTable is 'A.Cap' // No - at the end, There should have been 'A.Cap-' but in Database, MasterTable TNAME value = 'A.Cap-' // there is - at the end which is correct What is wrong ? Thank You
-
The problem is SOLVED The Field's size in SQLDataset was 5 (should have been 8 ) I change the Field's size to 8 and problem solved I'm really very very sorry i firstly should have checked that size property I apologize to everyone THANK YOU
-
Good Day, MyString could be 'Aaaa Bbbb <Axx Bxx>' or just '<Axx Bxx>' In any case i'd like delete just the part of <Axx Bxx> (Including < and >) What is the shortest way ? Thank You
-
Good Day, I have 2 printers, before print any doc i may change my printer via PrintDialog with below codes i can print my docs w/o any problem but when i change the to my second printer ( not default) i get empty paper (no print) what am i doing wrong ? QrPreview1.QRPrinter.PrinterIndex:= Printer.PrinterIndex; QrPreview1.QRPrinter.Print; Thank You
-
Good Day I want to round numbers 1 level UP, How can i do it ? If Value = 0,1 then Result= 1 If Value = 1,01 then Result= 2 If Value = 2,2 then Result= 3 If Value = 3,9 then Result= 4 If Value = 4,26 then Result= 5 etc Thank You
-
Thank you SO MUCH Uwe
-
I wish everyone a healthy day. I Converted my IB Database to FB w/o any problem (i was surprised, that was very easy) Now i need to transfer the datas from IB to FB What is the easiest way to do that ? Thank You
-
Good Day, var a,b : Double a:= 66,3333 b:= 1,5 c:= a* b ( Delphi shows c:= 99,5, actually c should be 99,49995 ) How can i get exact result ( 99,49995 ) ? Thank You
-
Good Day, I need to find out if there is SUNDAY between 2 dates For example : StartDate = 06/23/2023 , EndDate = 06/26/2023 ( Result = 1 , Because 06/25/2023 = Sunday ) StartDate = 06/23/2023 , EndDate = 07/03/2023 ( Result = 2 , Because there are 2 Sundays ) StartDate = 06/23/2023 , EndDate = 06/24/2023 ( Result = 0 ) Thank You
-
Good Day, How can i sort (descending) a table on a calculated field ? Thank You
-
Good Day, Delphi 10.3 When i compile or build my program i cant see in some code lines small BLUE POINT on the most left side of code screen so program doesnt read the lines with out blue point (I didnt change anything in Tools/Options.... etc.) . MyTable.Close; // There is blue point MyTable.Open; // No blue point Thank You
-
Thank you SO much David, KodeZwerg, Programmer I solved the problem.
-
Thank you so much Peter I dont convert anything My Code = a:= MyQuery.FieldByName('TOTAL').asFloat; (which is 66,3333.-) b:= MyQuery.FieldByName('RATIO').asFloat; (Which is 1,50 ); c:= a * b; // In Debug i see c as 99,50 instead of 99,4999 MyTable.Edit; MyTableBENF.asFloat := c; // i was expecting to see in mytable's BENF field 99,49 not 99,50 (BENF field in firebird3 database is as Numeric(15,2) (In Delphi my table's releated field's Currency proporties = True)
-
Good Day, I add Customer No & Customer Name in a combobox like below Combobox1.Items.AddObject(SQLQuery1.Fields[1].asString, Pointer(SQLQuery1.Fields[1].asInteger)); I want to make CutNo=1 record in the combobox selected (I mean, combobox1.text = CustNo=1 record's Customer Name) but i get, Identifier expected but 'OBJECT' found error msg. Combobox1.ItemIndex := Integer(Combobox1.Items.Object[Combobox1.ItemIndex]); Could someone please help Thank You
-
Combobox1.Items.AddObject(....)
Henry Olive replied to Henry Olive's topic in RTL and Delphi Object Pascal
Thank you so much Lajos, DelphiUdit, Programmer, David David, Combobox1.Text.AsInteger doesnt compile in D10.3 -
Good Day, Procedure TForm1.MyProc; begin .... end; TForm1..DBGrid2DblClick(Sender: TObject); begin MyProc = Nil; // i want to disable myproc procedure, how? ....... MyProc:=MyProc; // i want to enable myproc procedure, how? end; Thank You
-
Good Day, var Str,SubStr : String; Str := could be '100' or Str := could be '100,101' or Str := could be '100,101,102' ..... I have another variable which indicates delete number SubStr :=100 ( this could be 101 or 102 ...) I want to delete SubStr from Str that is if Str = 100 then Result :='' if Str = 100,101 then Result :='101' if Str = 100,101,102 then Result :='101,102' If SubStr ='101' then then Result := '100,102' If SubStr ='102' then then Result := '100,101 Could someone please show me how to do ? Thank You
-
Delete substring from a string
Henry Olive replied to Henry Olive's topic in RTL and Delphi Object Pascal
Sorry, i should have informed that they are always separated by commas Thank you so much aehimself, programmer, David -
Good Day, MyTable looks like below DOCNO 10-01 10-01 20-02 20-02 At the end I want to get ('10-01,20-02') // Every SINGLE DocNo with below code i'm getting '10-01,20-02,20-02' ( 20-02 should have been SINGLE ) DocNos :='' CDS1.First; while not CDS1.Eof do begin if DocNos ='' then DocNos := CDS1DOCNO.asString else if Pos(DocNos, CDS1DOCNO.AsString) = 0 then DocNos := DocNos + ','+ CDS1DOCNO.AsString; CDS1.Next; end; What am i doing wrong ? Thank You
-
Thank you so much David, actually my code is like yours but when i write here i made a mistake, otherwide Delphi doesnt compile
-
Thank you so much Aehimself
-
Thank you so much Programmer