查询问题(急)!!
我有四个字段日期是:来单日期、送货日期、开始来胚期、齐胚日期等,我要根据一个或者二个或者三个进行筛选出相应的结果我现有程是:可否帮我改一下,我这些可能有些错误,我是用表单中的:GRID表格浏览的,并且我要一打开就有所有数据然后根据相应的条件再出结果。 谢谢了帮帮忙忙,,,原先的程序是:Private Tmp1,Lpa,I
LPa=AllTrim(This.Parent.Text1.value)
Ldt1=This.Parent.Text2.value
Ldt2=This.Parent.Text3.value
Ldt3=This.Parent.Text4.value
Ldt4=This.Parent.Text5.value
Ldt5=This.Parent.Text6.value
Ldt6=This.Parent.Text7.value
Ldt7=This.Parent.Text8.value
Ldt8=This.Parent.Text9.value
Ldt9=This.Parent.Text10.value
Ldt10=This.Parent.Text11.value
Ldt11=This.Parent.Text12.value
Ldt12=This.Parent.Text13.value
Ldt13=This.Parent.Text14.value
Ldt14=This.Parent.Text15.value
Set Exact Off
set excl on
l_dbf=""
IF .not.empty(thisform.alias1)
sele(thisform.sele1)
l_dbf=dbf()
l_dbfs=sele()
else
endif
Select IIF(SeeK(A1.客户编号,'Cus','客户编号'),Cus.简称,Space(10)) As 客户,;
A1.单号,A1.布类,;
A1.来单日期,A1.送货日期,A1.开始来胚期,A1.齐胚日期,A1.计划排染期,A1.预计完成期,A1.实际完成期,;
A1.an1,A1.an2,A1.an3,A1.an4,A1.an5,A1.an6,A1.an7,A1.an8,A1.an9,A1.an10,A1.an11,A1.an12,;
A1.a1,A1.a2,A1.a3,A1.a4,A1.a5,A1.a6,A1.a7,A1.a8,A1.a9,A1.a10,A1.a11,A1.a12,;
A1.客户编号,A1.Bat_No;
From (ThisForm.KMa) As A1;
Where A1.来单日期>=Ldt1.And.A1.来单日期<=Ldt2.And.;
A1.送货日期=Ldt3.And.A1.送货日期=Ldt4.And.;
A1.开始来胚期=Ldt5.And.A1.开始来胚期=Ldt6.And.;
A1.齐胚日期=Ldt7.And.A1.齐胚日期=Ldt8.And.;
A1.计划排染期=Ldt9.And.A1.计划排染期=Ldt10.And.;
A1.预计完成期=Ldt11.And.A1.预计完成期=Ldt12.And.;
A1.实际完成期=Ldt13.And.A1.实际完成期=Ldt14.And.;
IIF(!Empt(Lpa),A1.单号=Lpa,.T.);
Order by A1.客户编号,A1.单号;
InTo Table (GetTempFile(W_Zmp))
ThisForm.Sele1=Select()
ThisForm.Alias1=Alias()
*Index On Bat_no Tag Bat_No
*set order to
set excl off
With This.Parent.Grid1
Go Top
If .Visible Then
.Visible=.F.
Use In (.RecordSource)
.RecordSource=''
.ColumnCount=-1
Endif