Using Windows11 (Dutch settings) LO-version 24.8.6.2 Database: Firebird (defined as server) Table in Firebird: JAREN Key-field J_NR Integer Relevant field: J_OPBR numeric (5,1) Table in LO: JAREN Relevant field: J_OBR number Macro used: Global iOPBR as single Global sSQL as string SUB ReadInfo sSQL = "Select J_OBR from JAREN where J_NR = 2025" oConnect=ThisDatabaseDocument.DataSource.getConnection("","") oQuery=oConnect.CreateStatement() oResult= oQuery.executeQuery(sSQLstring) oResult.Next iJaarOpbrVerw = oResult.getstring(1) etc. End sub When running as SQL in LO the result is 10,5 When displaying de value of iOPBR in macro the value is 105 When using iJOPR to populate a form-field defined with 1 decimal the value displayed is also 105 and not 10,5 as expected. What do I wrong and how to correct?
Using Windows11 (Dutch settings) LO-version 24.8.6.2 Database: Firebird (defined as server) Table in Firebird: JAREN Key-field J_NR Integer Relevant field: J_OPBR numeric (5,1) Table in LO: JAREN Relevant field: J_OPBR number Macro used: Global iOPBR as single Global sSQL as string SUB ReadInfo sSQL = "Select J_OPBR from JAREN where J_NR = 2025" oConnect=ThisDatabaseDocument.DataSource.getConnection("","") oQuery=oConnect.CreateStatement() oResult= oQuery.executeQuery(sSQLstring) oResult.Next iOPBR = oResult.getstring(1) etc. End sub When running as SQL in LO the result is 10,5 When displaying de value of iOPBR in macro the value is 105 When using iOPBR to populate a form-field defined with 1 decimal the value displayed is also 105 and not 10,5 as expected. What do I wrong and how to correct?
please attach a .odb to exhibit your bug. https://wiki.documentfoundation.org/QA/BugReport#Description_and_attachments
Created attachment 200802 [details] test, macro correction Hi, see correction of your macro. Problem is Macro Global iOPBR as single Global sSQL as string SUB ReadInfo sSQL = "Select deci_mal, nume_ric from Tabella1" oConnect=ThisDatabaseDocument.DataSource.getConnection("","") oQuery=oConnect.CreateStatement() oResult= oQuery.executeQuery(sSQL) oResult.Next iOPBR = oResult.getdouble(1) dec = oResult.getstring(1) num = oResult.getstring(2) print "iOPBR is " + iOPBR + " | decimal is " + dec + " | numeric is " + num End sub
(In reply to mc from comment #3) > Created attachment 200802 [details] > test, macro correction > > Hi, see correction of your macro. Problem is Macro > > Global iOPBR as single > Global sSQL as string > > SUB ReadInfo > sSQL = "Select deci_mal, nume_ric from Tabella1" > oConnect=ThisDatabaseDocument.DataSource.getConnection("","") > oQuery=oConnect.CreateStatement() > oResult= oQuery.executeQuery(sSQL) > oResult.Next > iOPBR = oResult.getdouble(1) > dec = oResult.getstring(1) > num = oResult.getstring(2) > print "iOPBR is " + iOPBR + " | decimal is " + dec + " | numeric is " + > num > End sub All clear now, thank you.