Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Updating a field in a complicated query - PLEASE HELP!

Slydog42Slydog42 Member Posts: 30
Hi, I am using Delphi, and I am filling in a database grid with a rather complicated query that looks like this:

SELECT b.Account_No, b.NTSELECT, MAX(b.Tot_Score) as Tot_Score, MAX(b.Tot_Hits) as Tot_Hits, MAX(a.Today_Hit) as Today_hit, MAX(b.TransDt_Dt) as TransDt_Dt, MAX(b.Posting_Dt) as Posting_Dt, MAX(a.FraudLevel) as FraudLevel,MAX(b.Short_Name) as Short_Name, MAX(b.TaxId_Ind) as TaxId_Ind, MIN(b.CollectBal) as CollectBal, MAX(b.DTOpen_Dt) as DTOpen_dt, MAX(b.CurLdgrBal) as CurLdgrBal, MAX(b.AverageBal) as AverageBal FROM R0_Red b, ACCTSUMM a
WHERE a.Account_No = b.Account_No AND b.BankBranch = 4
AND b.Ball = 'T' AND b.Posting_dt = '28-OCT-2002'
ORDER BY b.Account_No ASC

Now, the trouble is the fields b.NTSELECT. This query worked fine, and gave us a fully functional read-only data grid before this field was added. It has now been requested that we allow the user to update a boolean field, NTSELECT, in the R0_Red table on the fly.

Right from the beginning, I am uneasy about using being able to update records in a source dataset (R0_Red) by playing around on the screen with the true/false value of a boolean field sitting in the RESULT data set. However, I probably don't need to worry about that YET, as the query above simply *does not work*. NTSELECT is a logical (boolean) field defined in R0_Red. If I remove those two references to it, everything works fine, when I add them, I get back an ODBC/SQL error that says "TOO FEW PARAMETERS - EXPECTED 1".

Does anyone have any idea how to do this?

Many thanks to anyone who can help,


  • Shawn CarterShawn Carter Member Posts: 0

    ____ \ \ free ebooks and video tutorials about < Scratch, C#, MATLAB, PL/SQL, Objective-C, Delphi, R, JavaScript, Java, C++, Visual Basic .NET, C, PHP, Go, Swift, Python, Visual Basic, Ruby, Perl, Assembly ABAP, Apex, Ada, COBOL, F#, Logo, Clojure, Crystal, Transact-SQL, Kotlin, LabVIEW, Julia, Bash, Awk, Dart, Lua, Alice, Prolog, Lisp, Scheme, SAS, FoxPro, D, Erlang, Scala, Rust, Fortran, ML, Hack, VBScript /> ______

Sign In or Register to comment.