Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any smarter way for these query?
Message
 
 
To
14/01/2004 08:22:54
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00866688
Message ID:
00866695
Views:
18
Try
SELECT ti.ItemCode, ti.ItemName, ti.Qty, ;
			MAX(sl.sDate) AS MaxDate ;
	FROM tblitem ti 
	JOIN SalesDetails sd ON sd.ItemCode = ti.ItemCode ;
	JOIN Sales sl ON sl.SalesNo = sd.SalesNo ;
	GROUP BY 1,2,3 ;
	WHERE pLocation BETWEEN lcFromLocCode AND lcToLocCode ;
	HAVING MaxDate < ldDate 
>Hi,
>I would like to generate Slow Moving Item Report. It will show all items' detail that don't has any transaction since a particular date. Also, it should display last sales transaction date of slow moving item.
>
>I have the following code (under testing), but it is slow. Any smarter way?
>
>TableName : Sales
>Field : SalesNo, sDate ...
>Index : SalesNo, sDate
>
>TableName : SalesDetails
>Field : SalesNo, ItemCode, Qty ...
>Index : SalesNo, ItemCode
>
>TableName : tblItem
>Field : ItemCode, ItemName, Qty
>Index : ItemCode
>
<snip>
>
>
>Any suggestions? Thank you
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform