I am trying to create a form which acts like a dashboard, with the month-to-date, year-to-date and totals from a parent table (tblpatients) and 3 child tables which are linked to each other (tblpatients linked to tblcases linked to tblicda linked to tblcpt). I tried a summary table, but I can't include three different tables on a report or form.
I wrote this code, based on code in found under the query_create page in the wiki.
'Date Created: 19-Jan-2019 05:11:03 PM
'Last Updated: 19-Jan-2019 05:50:35 PM
'Created By : david
'Updated By : david
dim tbl as p
dim curmonth as c = s_quote(month(now()))
dim curyear as n = year(now())
dim varMTDCases as n
dim varMTDPts as n
dim varMTDwRVU as n
dim varMTDMCPay as n
dim varTotCases as N
dim varTotPts as N
dim varTotWRVU as N
dim varTotMCPay as n
dim varcurptid as n
dim setptr as p = set.open_session("setpatients")
dim demptr as p
dim caseptr as p
dim icdptr as p
dim cptptr as p
dim filter as c
dim qry as p
demptr = setptr.tbldemographics
caseptr = setptr.tblcases
icdptr = setptr.tblicda
cptptr = setptr.tblcpt
filter = "Month(DOS) = " + curmonth + ".AND. Year(DOS) = " + curyear
query.filter = "flattenquery (" + filter + ")"
qry = demptr.query_create()
setptr.fetch_first()
varTotPts = 0
while .not. setptr.fetch_eof()
varTotPts = vartotpts + 1
end while
varMTDCases = tablecount("tblcases", "Month(DOS) = " + curmonth + ".AND. Year(DOS) = " + curyear)
I get an error message telling me that
qry = demptr.query_create() No such field
As best I can tell, I set up the set pointer and table pointers correctly, but ....
Thank you for any help you can provide.
Dave
I wrote this code, based on code in found under the query_create page in the wiki.
'Date Created: 19-Jan-2019 05:11:03 PM
'Last Updated: 19-Jan-2019 05:50:35 PM
'Created By : david
'Updated By : david
dim tbl as p
dim curmonth as c = s_quote(month(now()))
dim curyear as n = year(now())
dim varMTDCases as n
dim varMTDPts as n
dim varMTDwRVU as n
dim varMTDMCPay as n
dim varTotCases as N
dim varTotPts as N
dim varTotWRVU as N
dim varTotMCPay as n
dim varcurptid as n
dim setptr as p = set.open_session("setpatients")
dim demptr as p
dim caseptr as p
dim icdptr as p
dim cptptr as p
dim filter as c
dim qry as p
demptr = setptr.tbldemographics
caseptr = setptr.tblcases
icdptr = setptr.tblicda
cptptr = setptr.tblcpt
filter = "Month(DOS) = " + curmonth + ".AND. Year(DOS) = " + curyear
query.filter = "flattenquery (" + filter + ")"
qry = demptr.query_create()
setptr.fetch_first()
varTotPts = 0
while .not. setptr.fetch_eof()
varTotPts = vartotpts + 1
end while
varMTDCases = tablecount("tblcases", "Month(DOS) = " + curmonth + ".AND. Year(DOS) = " + curyear)
I get an error message telling me that
qry = demptr.query_create() No such field
As best I can tell, I set up the set pointer and table pointers correctly, but ....
Thank you for any help you can provide.
Dave
Comment