Visual Fox Pro 6.0 逻辑数据类型查询不起作用!
我当前的系统有一个生成税务报告的查询。问题是,有时进入我们系统的订单从未提交,但仍计入税务报告中。将订单设置为已提交的标志称为“完整”,并且将使用逻辑数据类型将其设置为 TRUE。
以下代码出现两个问题。首先,我用作约束“完整”的字段似乎是 FoxPro 保留函数,因为它在 FoxPro 中呈蓝色亮起。第二个问题是它不会排除那些从未提交的记录(基本上约束不起作用)。
编辑代码:
sele bkmast
set order to county
set filt to between(sysdate, m.ld_start, m.ld_end)
go top
m.lh_countylines = ''
select 000000.0000 as ordamt, import, county, 00000000.00 as amount, date() as start, date() as end dist;
from bkmast ;
where !empty(county) ;
.and. alltrim(county) !='0' ;
.and. alltrim(county) !='8.00_Wyoming' ;
.and. alltrim(county) !='Select County' ;
order by county ;
into table countytax
m.ln_total=0
m.ln_countamt = 0
scan
m.lc_county = alltrim(county)
sele bkmast
seek m.lc_county
sum tax to m.ln_amt while county=m.lc_county
seek m.lc_county
sum ordamt to m.ln_ordamt while county=m.lc_county
sele countytax
replace ordamt with m.ln_ordamt
replace amount with m.ln_amt
replace startDate with m.ld_start
replace endDate with m.ld_end
m.ln_countamt = m.ln_countamt + ordamt
m.ln_total = m.ln_total + amount
m.lh_countylines = m.lh_countylines+elemerge(html_frm("TAXCOUNTY1"))
endscan
非常感谢任何帮助。
My current system has a query to generate a tax report. The problem is that sometimes orders go into our system that never get submitted but are still counted in the tax report. The flag that sets an order as submitted is called 'complete' and it will be set to TRUE using the logical datatype.
Two issues arise from the following code. First, it seems as though the field I am using as a constraint 'complete' is a FoxPro reserved function because it lights up in blue while in FoxPro. The second problem is that it will not exclude those records that never get submitted (basically the constraint is not working).
EDITED CODE:
sele bkmast
set order to county
set filt to between(sysdate, m.ld_start, m.ld_end)
go top
m.lh_countylines = ''
select 000000.0000 as ordamt, import, county, 00000000.00 as amount, date() as start, date() as end dist;
from bkmast ;
where !empty(county) ;
.and. alltrim(county) !='0' ;
.and. alltrim(county) !='8.00_Wyoming' ;
.and. alltrim(county) !='Select County' ;
order by county ;
into table countytax
m.ln_total=0
m.ln_countamt = 0
scan
m.lc_county = alltrim(county)
sele bkmast
seek m.lc_county
sum tax to m.ln_amt while county=m.lc_county
seek m.lc_county
sum ordamt to m.ln_ordamt while county=m.lc_county
sele countytax
replace ordamt with m.ln_ordamt
replace amount with m.ln_amt
replace startDate with m.ld_start
replace endDate with m.ld_end
m.ln_countamt = m.ln_countamt + ordamt
m.ln_total = m.ln_total + amount
m.lh_countylines = m.lh_countylines+elemerge(html_frm("TAXCOUNTY1"))
endscan
Any help is greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
自 87 年 FoxBase 以来一直使用 Foxpro,我从来不知道“完整”命令,也没有直接记录在 VFP 帮助中(但如上所述,确实通过 Complete() 以蓝色突出显示作为函数调用)。另外.AND。是很久以前的旧查询指标。 “结束”虽然是一个关键字。我会尝试通过向查询添加别名并将 End 更改为 EndDate (并将 Start 与 StartDate 配对)来限定列,例如...
从您其他评论的结果中,我将直接在select 语句,然后进行更新...
在这种情况下,由于订单金额和税费的聚合,您不需要返回 BKMast 表...它已经完成...您可以循环遍历直接得到结果集。剩下的唯一一件事就是总结总税费和订单金额...如果这些变量未在您的 elemerge(html_frm("TAXCOUNTY1")) 调用中使用,您可以直接对它们进行预先求和
Having worked with Foxpro since FoxBase back in '87, I've never known a "complete" command, nor is it directly documented in the VFP Help (yet as stated, DOES highlight in blue as a function call via Complete() ). Additionally the .AND. is long ago old indicator of query. The "End" though IS a keyword. I would try by qualifying the columns by adding the alias to the query and changing End to EndDate (and pairing up Start to StartDate), such as...
From the result of your other comment, I would do your pre-querying directly in the select statement, then do your updates...
In this case, since the aggregations of order amount and tax, you don't need to go back to the BKMast table... its already done... you can just cycle through the result set directly. The only thing left would be to sum up the total tax and order amounts... If those variables are not used within your elemerge(html_frm("TAXCOUNTY1")) call, you can just pre-sum those directly
如果您运行一个查询,其中 WHERE 子句中只有 this 是完整的,会发生什么:
这是否获得了正确的记录集?我的意思是,“完整”字段可能不包含您认为的内容。
添马舰
What happens if you run a query where the only this in the WHERE clause is complete:
Does that get the right set of records? What I'm getting at is that maybe the Complete field doesn't contain what you think it does.
Tamar