how to assign the sql query results
Code: Select all
select sum(value) from invoice where poz='123'
regards
Miloš
Code: Select all
select sum(value) from invoice where poz='123'
mtajkov wrote:Hi,
how to assign the sql query resultsto the variable?Code: Select all
select sum(value) from invoice where poz='123'
regards
Miloš
Code: Select all
select sum(value) as newname from invoice where poz='123'
Code: Select all
Function New()
Local NewName:=0
oSql:exec("SELECT sum(Value) AS NewName FROM Invice WHERE poz='123')
MsgInfo(NewName)
return
mtajkov wrote:The result is constantly 0?
Code: Select all
Function New() Local NewName:=0 oSql:exec("SELECT sum(Value) AS NewName FROM Invice WHERE poz='123') MsgInfo(NewName) return
Code: Select all
cSQL := "SELECT sum(Value) AS NewName FROM Invice WHERE poz='123'"
oSql:exec( cSql,,.t.,@aData )
NewName := aData[1][1]
Code: Select all
oQryId := TDolphinQry():New( "SELECT last_insert_id() AS nId", oDatos:oConex )
nVar := oQryId:nId