Hi all, it's me again. I am having a problem with a filter in an append operation. It seems to me it should work but of course it doesn't. Here is my script:
dim Tbl as P
dim user as D
dim A_tbl as P
tbl = table.open("ameregl3")
dstr = ui_get_date("Report Date","Please Enter a Date")
if dstr=""then
end
end if
user=ctod(dstr)
tbl = table.current()
A_tbl = table.open("Daily_Report")
append.t_db = "\\amesrv\e\a5\ameregl3.dbf"
append.m_key = ""
append.t_key = "Recno()"
append.m_filter = ""
append.t_filter = "Date_out=(user)"
append.type = "All"
append.m_count = 4
append.m_field1 = "Date_Out"
append.m_exp1 = "@ameregl3->Date_Out"
append.m_field2 = "Code"
append.m_exp2 = "@ameregl3->Code"
append.m_field3 = "Completed_by"
append.m_exp3 = "@ameregl3->Pouch__"
append.m_field4 = "Entered_by"
append.m_exp4 = "@ameregl3->Summons"
append.t_count = 0
A_tbl.append()
End
What I'm trying to accomplish is to be able to set the date for the filter. In queries, this always works and is never a problem. In my append operation, A5 is looking at "(user)" as a field and not an actual date. It is therefore stating "No such field". It should be looking at "(user)" as a date. When I insert a date, within brackets of course, the append works flawlessly. I must be missing something obvious and must not be able to see the forest through the trees. Any ideas why this isn't working properly? And as always, thanks for the replies and ideas.
dim Tbl as P
dim user as D
dim A_tbl as P
tbl = table.open("ameregl3")
dstr = ui_get_date("Report Date","Please Enter a Date")
if dstr=""then
end
end if
user=ctod(dstr)
tbl = table.current()
A_tbl = table.open("Daily_Report")
append.t_db = "\\amesrv\e\a5\ameregl3.dbf"
append.m_key = ""
append.t_key = "Recno()"
append.m_filter = ""
append.t_filter = "Date_out=(user)"
append.type = "All"
append.m_count = 4
append.m_field1 = "Date_Out"
append.m_exp1 = "@ameregl3->Date_Out"
append.m_field2 = "Code"
append.m_exp2 = "@ameregl3->Code"
append.m_field3 = "Completed_by"
append.m_exp3 = "@ameregl3->Pouch__"
append.m_field4 = "Entered_by"
append.m_exp4 = "@ameregl3->Summons"
append.t_count = 0
A_tbl.append()
End
What I'm trying to accomplish is to be able to set the date for the filter. In queries, this always works and is never a problem. In my append operation, A5 is looking at "(user)" as a field and not an actual date. It is therefore stating "No such field". It should be looking at "(user)" as a date. When I insert a date, within brackets of course, the append works flawlessly. I must be missing something obvious and must not be able to see the forest through the trees. Any ideas why this isn't working properly? And as always, thanks for the replies and ideas.
Comment