Jump to content

Henry Olive

Members
  • Content Count

    330
  • Joined

  • Last visited

Everything posted by Henry Olive

  1. Henry Olive

    Excel to DBGrid

    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
  2. Henry Olive

    Excel to DBGrid

    Thank you aehimself
  3. Henry Olive

    Excel to DBGrid

    Thank you FPiette
  4. 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
  5. Henry Olive

    SQL expression evaluation not supported

    Thank you so much David, CorneliusDavid, Lajos
  6. Henry Olive

    SQL expression evaluation not supported

    Thank You again Frickler, I tried your last suggestion ( simple case) but still getting the same err. msg.
  7. Henry Olive

    SQL expression evaluation not supported

    Thank You Frickler, If i remove parentheses nothing changes , still get the same err.msg.
  8. 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
  9. Henry Olive

    Client Data Set FILTER

    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.
  10. 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
  11. Henry Olive

    SQL Integer Overflow

    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
  12. Henry Olive

    Prevent Alt or Ctrl + Print Screen

    Thank you so much everbody. Uwe you made me laugh (You are absolutly right !!)
  13. Henry Olive

    Prevent Alt or Ctrl + Print Screen

    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;
  14. Henry Olive

    SQL

    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
  15. Henry Olive

    SQL

    Thank you so much Lajos, Stano
  16. Henry Olive

    SQL

    Thank you Bazzer747 Yes it is a question, How can i get requested result from the table by SQL ?
  17. Henry Olive

    Pos

    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
  18. Henry Olive

    Pos

    Thank you so much David
  19. Henry Olive

    DBEdit.Items

    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
  20. Henry Olive

    SQL with Sum & Case

    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
  21. Henry Olive

    SQL with Sum & Case

    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.
  22. Henry Olive

    Disable DBComboBox

    I wish everyone a healthy day. I have DBComboBox1 with 2 Items (Open, Closed) I have another DBComboBox2 which it is Field Name=ClosedDate I dont want user to fill Closed Date Field if DBComboBox1.Text=Open So I wrote below code DBComboBox2.Enabled :=DBComboBox1.Text='Closed'; Which event is the best place to put above code ? Thank You
  23. Henry Olive

    Disable DBComboBox

    Thank you so much Lajos
  24. I have 6 Labels on my form I need to fill them according to a query result but i dont know how many data returns ( may be NONE may be 1 may be 6 ( which is MAX) I wrote below codes var MyLabel : TLabel; while not Query1.Eof do begin if Query1.Fields[0].AsString <> '' then begin MyLabel.Caption :=Query1.Fields[0].AsString + ' - Responsible :'; MyLabel.Caption := dm.GetNextDocNo(MyLabel.Name); // i find next label.caption // Above dm.GetNextDocNo function Increases number in a string) which works well // for example if MayLabel.Name ='Label1' then this function makes it 'Label2' so on // My problem is in below how can i get Label.Name from Label.Caption ? // so that I can fill other labels ? MyLabel := ??? end; Query1.Next; end;
  25. Henry Olive

    Getting Label Name from Label.Caption

    Thank you so much David
×