Henry Olive
Members-
Content Count
284 -
Joined
-
Last visited
Everything posted by Henry Olive
-
Is there an easy way to get Alfabetical (English) order number of a letter like C=3 , E=5 , H=8 .... Thank You
-
Alfabetical order of a letter
Henry Olive replied to Henry Olive's topic in RTL and Delphi Object Pascal
Thank you so much Vandrovnik, David, Lars My excel sheet always has 12 columns no more Vandrovnik, with below code I get Low cannot be applied to a long string err.msg. Str := Edit1.Text; // Edit1..Text:='D' Num := Ord([Low(Str)]) - Ord('A') + 1; Edit2.Text := IntToStr(Num); But below code WORKS Num := Ord(Str[1]) - Ord('A') + 1; Thank you so much -
Alfabetical order of a letter
Henry Olive replied to Henry Olive's topic in RTL and Delphi Object Pascal
Thank you Vandrovnik, eivind From an Excel Sheet i get column name ( for example F ) then i need to convert F to an integer number ( which is 6 ) so that i can import some datas from excel to my dataset. Str:=Edit1.Text; // Which is D Num := Ord(PChar(Str)) - Ord('A')+1; Edit2.Text := IntToStr(Num); I'm getting 37266172 instead of 4 -
Alfabetical order of a letter
Henry Olive replied to Henry Olive's topic in RTL and Delphi Object Pascal
Thank you Lajos, if Edit1.Text ='A' then // (Edit1.Text =D) Edit2.Text := '1' else Edit2.Text := IntToStr(ord(Edit1.Text) - ord('A')+1); Expecting 4 but getting 37266172 with below code i get correct result ShowMessage(IntToStr(Ord('D') - Ord('A')+1)); -
I wish everyone a healthy day. Excel (Row1 =Date, Row2=Quantity) A............................B.........................C....................... 1...05-01-2021......05-02-2021.....05-03-2021 2...150..................... 200......................250 I need to import above datas into my table as below Date.........................Qty 05-01-2021..........150 05-02-2021..........200 05-03-2021..........250 ........ ........ Could someone please show me how to do ? Thank You
-
Thank you aehimself
-
Thank you FPiette
-
I wish everyone a healthy day Interbase SQL I'm getting expression evaluation not supported err.msg. with below SQL If I remove (Case.........end) which is 2.Line in SQL command, The Sql works What is wrong ? SELECT O.DELVTYPE, SUM(OD.REMAINQTY) QTY, (Case When O.DELVTYPE ='Sea' then O.DELVDATE + 45 else O.DELVDATE + 15 end) as DELVDATE FROM ORDETAIL OD JOIN ORDERS O ON O.RNO=OD.RNO WHERE OD.ITEMNO = 'ABX22' GROUP BY O.DELVTYPE, O.DELVDATE HAVING SUM(OD.REMAINQTY) > 0 Thank You
-
SQL expression evaluation not supported
Henry Olive replied to Henry Olive's topic in RTL and Delphi Object Pascal
Thank you so much David, CorneliusDavid, Lajos -
SQL expression evaluation not supported
Henry Olive replied to Henry Olive's topic in RTL and Delphi Object Pascal
Thank You again Frickler, I tried your last suggestion ( simple case) but still getting the same err. msg. -
SQL expression evaluation not supported
Henry Olive replied to Henry Olive's topic in RTL and Delphi Object Pascal
Thank You Frickler, If i remove parentheses nothing changes , still get the same err.msg. -
Delphi-XE dm.SDetail.Filtered:=False; if (SearchText[1]='*') then // SearchText comes from a variable with UPPERCASE begin Delete(SearchText,1,1); // Deleting * FilterText:='UPPER(ITEMNAME) CONTAINING '+QuotedStr(SearchText); end else FilterText:='UPPER(ITEMNAME) STARTS '+QuotedStr(SearchText); dm.SDetail.Filter:=FilterText; dm.SDetail.Filtered:=True; I'm getting Filter Expression Incorrectly Terminated. What is wrong ? Thank You
-
Thank you so much aehimself, You are right we cant use SQL commands STARTS-CONTAINING in Filter Expressions. I used LIKE and SearchText+% LIKE and %+SearchText+% Thank you again.
-
I wish everyone a healthy day Is there a away to prevent getting picture of a form ( Prevent Alt or Ctrl Print Screen ) ? Thank You
-
Interbase, SELECT IM.ITEMNO, SUM(Case When IM.TNAME = 'Sell' then IM.QTY * (IM.UPRICE * IM.CURRRATE) else 0 end) FROM ITEMMOVEMENTS IM GROUP BY IM.ITEMNO I get Integer Overflow error msg. I Tried SUM(Case When IM.TNAME = 'Sell' then CAST(IM.QTY * (IM.UPRICE * IM.CURRRATE) AS NUMERIC(18,2)) else 0 end) I again get Integer Overflow error msg. I also tried CAST(SUM(Case When IM.TNAME = 'Sell' then IM.QTY * (IM.UPRICE * IM.CURRRATE) else 0 end) AS NUMERIC(18,2)) I again get Integer Overflow error msg. Any suggestion ? Thank You
-
Prevent Alt or Ctrl + Print Screen
Henry Olive replied to Henry Olive's topic in RTL and Delphi Object Pascal
Thank you so much everbody. Uwe you made me laugh (You are absolutly right !!) -
Prevent Alt or Ctrl + Print Screen
Henry Olive replied to Henry Olive's topic in RTL and Delphi Object Pascal
What if the form shows digital Stamp & Signature ? My all other forms can make screen shot p.s : Even though i have below code on the form's OnCreate if dm.UsrRightADMINRIGHT.AsString ='No' then TabSheetStamp.TabVisible:=False; -
I wish everyone a healthy day. Interbase-2007 I have below table ITEMNO.....TNAME......QTY...UPRICE AAA...............Buy..........10.........5,00 AAA...............Buy..........20.........5,00 AAA...............Sell............4..........7,00 AAA...............Return......2..........7,00 BBB...............Buy............6..........6,00 BBB...............Sell.............3..........8,00 CCC...............Buy.........12........10,00 Requested Result by (QTY * UPRICE) for each item ITEMNO.....TOTALBUY....TOTALSELL......TOTALRETURN AAA...................150,00..........28,00................14,00 BBB......................36,00...........24,00..................0,00 CCC...................120,00...........0,00.....................0,00 Thank You
-
I wish everyone a healthy day. MyStr :='Lorem Ipsum '; I want to delete ALL empty/blank strings end of MyStr ( I dont know MyStr has how many empty strings ) Required Result :='Lorem Ipsum' Thank You
-
Thank you so much David
-
I wish everyone a healthy day. I have a DBEdit & Its has 1 item 'Abc' (Style = csDropDown) But in another record i also want to write something in to DBEdit by hand '123' If i write DBEdit by hand after close & re-open the form even though I see the record in the database.(written by hand value) i cant see the DBEdit.Text (Field Value) which i filled by hand 1 minute ago what is wrong ? Thank You
-
I wish everyone a healthy day. Interbase 2007 SELECT C.CUSTNO, C.CUSTNAME, SUM (CM.DEBIT-CM.CREDIT)BALANCE, Case When CAST(SUM (CM.DEBIT-CM.CREDIT) AS NUMERIC(15,2)) > 0 then 'Debit' else 'Credit' end as STATE FROM CUSTMOVEMENTS CM /* it is a View */ LEFT JOIN CUSTOMER C ON CM.CUSTNO=C.CUSTNO WHERE CM.TDATE <= '03/30/2021' GROUP BY C.CUSTNO, C.CUSTNAME HAVING SUM (CM.DEBIT-CM.CREDIT) <> 0 In the Results, BALANCES are correct but some State is wrong CustNo...CustName........Balance.....State 1.................AAA.......................1000.......Debit (Correct) 2.................BBB....................... 2000.......Credit (should have been Debit) 3.................CCC..................... -3000.......Debit (should have been Credit) I had to use CAST in above sql because if i dont use it i get Bad BLR Invalid Stream error msg. What am i doing wrong ? Thank You
-
Thank you so much Virgo. IB-2007 doesnt have CTE & Derived table I solved my problem in Delphi side, adding a Calc Field into Query result.