• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LiveCloud arrays and Datagrid
#8
I got it....The issue was the query operator,

for anyone trying to search records look at query operators in the documentation ..graaah

Heres the code to search records between 2 dates and display it into the datagrid (You will have to adjust to suit your keys)

Important Note: If you just use ">=" and "<=" this will leave out dates between 01 and 09 if you run a query from lets say the 1 december to the 20 december...use "date>=" and "date<="

on mouseUp pButtonNumber
local tInputA, tOutputA, tTableID, tKeys, tCount, tDataA, tRecordID, tFromDate, tToDate,

put text of field "dateFromField" into tToDate
convert tToDate to short date
put text of field "dateToField" into tFromDate
convert tFromDate to short date

put cdb_TableID("logs") into tTableID
put cdb_tableKeys("logs") into tKeys


put "date" into tInputA[tTableID]["query2"]["key"]
put "date<=" into tInputA[tTableID]["query2"]["operator"]
put tFromDate into tInputA[tTableID]["query2"]["value"]
put "date" into tInputA[tTableID]["query1"]["key"]
put "date>=" into tInputA[tTableID]["query1"]["operator"]
put tToDate into tInputA[tTableID]["query1"]["value"]

put cdb_batchQuery(tInputA,"cloud","logicalAND","recordData") into tOutputA

put 0 into tCount
repeat for each key xRecordID in tOutputA[tTableID][1]
add 1 to tCount

put tOutputA[tTableID][1][xRecordID]["cdb"]["cdbRecordID"] into tRecordID
repeat for each item xKeyName in tKeys
put tOutputA[tTableID][1][xRecordID][xKeyName] into tDataA[tCount][xKeyName]
end repeat
end repeat

set the dgData of group "DataGridLogs" to tDataA
set the dghProp["saved data"] of group "DataGridLogs" to tDataA
end mouseUp
  Reply


Messages In This Thread
LiveCloud arrays and Datagrid - by Bizbuzz - 11-21-2019, 11:01 AM
RE: LiveCloud arrays and Datagrid - by efrain.c - 11-21-2019, 07:03 PM
RE: LiveCloud arrays and Datagrid - by Papa Cann - 02-23-2020, 03:47 PM
RE: LiveCloud arrays and Datagrid - by efrain.c - 02-24-2020, 06:26 PM
RE: LiveCloud arrays and Datagrid - by sid - 12-14-2019, 11:27 PM
RE: LiveCloud arrays and Datagrid - by sid - 12-16-2019, 09:31 PM
RE: LiveCloud arrays and Datagrid - by efrain.c - 12-17-2019, 02:14 AM
RE: LiveCloud arrays and Datagrid - by sid - 12-17-2019, 09:54 PM
RE: LiveCloud arrays and Datagrid - by sid - 12-18-2019, 10:20 PM
RE: LiveCloud arrays and Datagrid - by sid - 12-19-2019, 10:12 PM
RE: LiveCloud arrays and Datagrid - by sid - 02-14-2020, 02:56 PM
RE: LiveCloud arrays and Datagrid - by efrain.c - 02-14-2020, 08:47 PM
RE: LiveCloud arrays and Datagrid - by sid - 02-15-2020, 07:52 PM
RE: LiveCloud arrays and Datagrid - by sid - 02-24-2020, 07:52 PM
RE: LiveCloud arrays and Datagrid - by efrain.c - 02-24-2020, 09:17 PM
RE: LiveCloud arrays and Datagrid - by sid - 02-24-2020, 09:39 PM
RE: LiveCloud arrays and Datagrid - by sid - 06-26-2020, 11:34 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)