Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why does this query work, but as view does not
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01203343
Message ID:
01203350
Views:
15
>I have a view that works in the designer, if I take it out and put it in aprogram and run as a query it works, but place the view in a form and it does not return any data. Code below is the view definition.
>
>SELECT 	VAL(Customer.Code) as ValCode,Invhead.*, Ordhead.location, Ordhead.entered,	 	 ;
>Ordhead.priorityorder, ;
>Ordhead.customerpo,Ordhead.daterequired, 			 ;
>Ordhead.comm1, Ordhead.comm2, Ordhead.comm3, Ordhead.terms, Customer.name, ;
>Customer.code, Customer.creditlmt, Customer.einnumber, 		 ;
>Customer.specialdisc, Customer.dollarsuse, Ordhead.customerid, 							 ;
>Customer.Country as CustCountry,				 										 ;
>ProdQty.TotOrdered,ProdQty.TotAllocated,ProdQty.TotShipped,.F. as Ok,					 ;
>RdyToShip.RdyToShip,Shipped.Shipped,	 ProdQty.SpecialOrd,							 ;
>ALLTRIM(STR(OrdHead.OrderId))+IIF(OrdHead.SBO,"B"," ") as DispOrdNo,Customer.OnHold		 ;
>FROM frantisi!ordhead 																	 ;
>INNER JOIN frantisi!invhead 	ON  Ordhead.orderid = Invhead.orderid 					 ;
>INNER JOIN frantisi!shipped 	ON  Ordhead.orderid = Shipped.orderid 					 ;
>INNER JOIN frantisi!rdytoship 	ON  Invhead.invoiceno = Rdytoship.invoiceno 			 ;
>INNER JOIN frantisi!customer 	ON  Customer.customerid = Ordhead.customerid 			 ;
>INNER JOIN frantisi!prodqty  	ON  Ordhead.orderid = Prodqty.orderid 					 ;
> WHERE (  Ordhead.daterequired <= ( ?ldDateReqd )										 ;
>   AND  Ordhead.location = ( ?lnLocation ) )											 ;
>   AND  (  EMPTY(dispatchdate) 															 ;
>   AND  NOT (EMPTY(Invhead.picked) ) )													 ;
>ORDER 	BY Ordhead.priorityorder desc, 1,Invhead.InvoiceNo	
>
>The code in the form is thus:
>ldDateReqd=thisform.DateRequired.Value
>lnLocation=thisform.Location.value
>=Requery("DISPATCH")
>
>When this code executes, there is no data returned, yet if I run it in the view designer, it works.
>
>Any ideas?
>
>TIA,
>Mike

May be the date settings are to blame? What is STRICTDATE format? Also I prefer to not use EMPTY function, but do something like DispatchDate = {} and InvHead.Picked = .f.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform