求救FOXPRO高手,多谢多谢多多谢

zhaoshaom 2002-12-24 01:18:28
能不能帮我LOOK下有没错误。
select * ;
from moneyf ;
into cursor c_tmp ;
where iif(m_a_mcode, .t., between(f_mcode, m_f_mcode, m_t_mcode)) ;
and iif(m_a_ctcode, .t., between(f_spec,m_f_ctcode, m_t_ctcode)) ;
and iif(m_a_bcode, .t., between(f_bcode, m_f_bcode, m_t_bcode)) ;
and iif(m_a_mdate, .t., between(f_mdate, m_f_mdate, m_t_mdate)) ;
and iif(m_a_icode, .t., between(f_icode, m_f_icode, m_t_icode)) ;
and iif(m_type=1, between(val(f_icode),101,999), .t.) ;
and iif(m_type=2, between(val(f_icode),101,499), .t.) ;
and iif(m_type=3, between(val(f_icode),501,599), .t.) ;
and iif(m_type=5, between(val(f_icode),701,799), .t.) ;
and iif(m_type=6, between(val(f_icode),801,849), .t.) ;
and iif(m_type=7, between(val(f_icode),850,899), .t.) ;
and iif(m_type=4, between(val(f_icode),901,999) or between(val(f_icode),601,699) , .t.)
&& sz xhf 2002.12.23 }}

m_typen = v_typen()

select f_ctcode,f_spec, f_iname,f_mcode,f_bcode,f_miquan,f_mpricea ;
from c_tmp;
into cursor c_tmp1;
group by f_ctcode,f_icode;
order by f_ctcode

select c_tmp
sum f_miquan,f_miquan *f_mpricea to m_mquan,m_price for f_ctcode=c_tmp1.f_ctcode

&& xhf 2002.12.23 {{
create cursor c_xtmp (;
f_ctcode c(15) ,;
f_mquan n(15,4) ,;
f_price n(15,4) )

index on f_ctcode tag f_ctcode

select f_ctcode, sum(f_miquan) as f_mquan,;
sum(f_mpricea*f_miquan) as f_price;
from c_tmp;
into cursor c_xtmp1;
group by f_ctcode

select c_xtmp
append from dbf('c_xtmp1')
set order to f_ctcode
&& xhf 2002.12.23 }}

select c_tmp1
&& set relation to f_ctcode into customermf,f_bcode into buyerf && xhf 2002.12.23
set relation to f_ctcode into customermf,f_bcode into buyerf, f_ctcode into c_xtmp && xhf 2002.12.23

select c_tmp1
scan
&& xhf 2002.12.20 {{
*!* select c_tmp
*!* select sum(f_miquan) as m_mquan,sum(f_mpricea * f_miquan) as m_price;
*!* from c_tmp;
*!* into cursor c_tmp2;
*!* where c_tmp.f_ctcode=c_tmp1.f_ctcode
&& xhf 2002.12.20 }}

select c_p_tmp
append blank
replace f_ctcode with c_tmp1.f_ctcode
replace f_bcode with c_tmp1.f_bcode
replace f_mpricea with c_tmp1.f_mpricea
replace f_bname with buyerf.f_name
replace f_miquan with c_tmp1.f_miquan
replace f_iname with c_tmp1.f_iname
replace f_mcode with c_tmp1.f_mcode

&& xhf {{
*!* replace f_shname with iif(empty(f_spec),customermf.f_shname,c_tmp1.f_spec)
replace f_shname with iif(empty(c_tmp1.f_spec),customermf.f_shname,c_tmp1.f_spec) && xhf
replace f_quan with c_xtmp.f_mquan
replace f_add with c_xtmp.f_price
*!* replace f_quan with c_tmp2.m_mquan
*!* replace f_add with c_tmp2.m_price
&& xhf }}
endscan

select c_tmp
sum f_miquan*f_mpriceo to m_add1
sum f_miquan*f_mpricea to m_add2

&& xhf 2002.12.23 注:m_add1,m_add2可设成报表变量

select c_tmp
set relation to

select moneyf
set relation to

*!* select c_tmp2
*!* set relation to


select c_p_tmp
go top

if eof()
messagebox('没有数据可打印',64,'信息窗口')
else
if !file(s_rptdir + 'd_money.frx')
messagebox("报表文件不存在",64,"信息窗口")
else
report form (s_rptdir + 'd_money2.frx') preview name _printf
s_curform = 'p_money1'
s_object = m_obj
set procedure to p_money1

endif
endif
endif
...全文
48 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
馮強 2002-12-25
  • 打赏
  • 举报
回复
iif(m_a_icode, .t., between(f_icode, m_f_icode, m_t_icode))

这句就有毛病,iif()要求返回明确的值,当m_a_icode为假时,返回between中的任一值。你让解释器帮你判断?当然通不过了。
sbw 2002-12-24
  • 打赏
  • 举报
回复
看不懂耶。
dongbear 2002-12-24
  • 打赏
  • 举报
回复
超过255字符操作会失败
boomit 2002-12-24
  • 打赏
  • 举报
回复
哈。。。太多了。。。
magnetmoon 2002-12-24
  • 打赏
  • 举报
回复
忒麻烦!脑袋大了!你把出错的那句帖出来就行了!
newfang 2002-12-24
  • 打赏
  • 举报
回复
忒麻烦,你把意思说一下不就中了…………
耙子 2002-12-24
  • 打赏
  • 举报
回复
看得我脑袋大了!
楼主的书写风格有问题。
coolyylu 2002-12-24
  • 打赏
  • 举报
回复
少了一个if或者多了一个endif(最后一个)

另外你的代码写得不是很好看.

2,723

社区成员

发帖
与我相关
我的任务
社区描述
VFP,是Microsoft公司推出的数据库开发软件,用它来开发数据库,既简单又方便。
社区管理员
  • VFP社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧