I'm having a problem with a script I'm trying to run. The script is as follows:
dim Tbl as P
dim user1 as C
dim begindate as D
dim enddate as D
tbl = table.open("ameregl3")
tstr1 = ui_get_text("Client Name","Please Enter a Client Name")
if tstr1=""then
end
end if
user1=(tstr1)
dstr = ui_get_date("Beginning Date?","How Far Back Do You Wish To Go")
if dstr=""then
end
end if
begindate=ctod(dstr)
dstr = ui_get_date("Drop Dead Date","Please Enter Drop Dead Date")
if dstr=""then
end
end if
enddate=ctod(dstr)
tbl = table.current()
query.description = ""
query.order = ""
query.filter = "AMEREGL3->ATTORNEY=\"(user1)\".AND.BETWEEN(AMEREGL3->DROP_DEAD,(begindate),(enddate)).AND.ISBLANK(\"AMEREGL3->DATE_COMP\")"
query.options = "I"
tbl.query_create()
END
When I tried debugging, once I got to "tbl.query_create() and hit F12, it shoots straight down to "END" without performimg the query. I've never come across this particular problem before. If I run the query from the "Query Genie", it operates as it should. There should be 212 records. The query should show any records under those parameters that are blank in the "Date_Comp" field. My intention is to run this query then export the records to an excel file. When I create a script with a query, the first thing I do is to create the query and test it before going any further. I even thought about breaking the filter down to 3 separate queries within the script but when I tried that, the queries would query the complete table and not my current table with the results from the previous query before it even though I had "tbl=table.current()". I'm stumped on this. It seems to me that my original query should work, but it seems to do nothing. It takes just one second to run and says "0 Records". Any input would be very helpful. Our database has over 78,000 records and is quite extensive so I know the query should take just a bit, certainly more than almost instantaneous. Thanks for any help guys. I'll be leaving my office but will check the forum and get back to any replies as soon as I can.... Thanks....
Scott
dim Tbl as P
dim user1 as C
dim begindate as D
dim enddate as D
tbl = table.open("ameregl3")
tstr1 = ui_get_text("Client Name","Please Enter a Client Name")
if tstr1=""then
end
end if
user1=(tstr1)
dstr = ui_get_date("Beginning Date?","How Far Back Do You Wish To Go")
if dstr=""then
end
end if
begindate=ctod(dstr)
dstr = ui_get_date("Drop Dead Date","Please Enter Drop Dead Date")
if dstr=""then
end
end if
enddate=ctod(dstr)
tbl = table.current()
query.description = ""
query.order = ""
query.filter = "AMEREGL3->ATTORNEY=\"(user1)\".AND.BETWEEN(AMEREGL3->DROP_DEAD,(begindate),(enddate)).AND.ISBLANK(\"AMEREGL3->DATE_COMP\")"
query.options = "I"
tbl.query_create()
END
When I tried debugging, once I got to "tbl.query_create() and hit F12, it shoots straight down to "END" without performimg the query. I've never come across this particular problem before. If I run the query from the "Query Genie", it operates as it should. There should be 212 records. The query should show any records under those parameters that are blank in the "Date_Comp" field. My intention is to run this query then export the records to an excel file. When I create a script with a query, the first thing I do is to create the query and test it before going any further. I even thought about breaking the filter down to 3 separate queries within the script but when I tried that, the queries would query the complete table and not my current table with the results from the previous query before it even though I had "tbl=table.current()". I'm stumped on this. It seems to me that my original query should work, but it seems to do nothing. It takes just one second to run and says "0 Records". Any input would be very helpful. Our database has over 78,000 records and is quite extensive so I know the query should take just a bit, certainly more than almost instantaneous. Thanks for any help guys. I'll be leaving my office but will check the forum and get back to any replies as soon as I can.... Thanks....
Scott
Comment