Select orders.RequiredDate, orders.ShippedDate, orders.Freight, orders.ShipName, orders.ShipAddress, orders.OrderDate FROM orders Where orders.OrderDate Between [Forms]![DateFilter]![DateFrom] And [Forms]![DateFilter]![DateTo]));
TRANSFORM Sum(CCur([Order Details].UnitPrice*[Quantity]*(1-[Discount])/100)*100) AS ProductAmount Select Products.ProductName, orders.CustomerID, Year([OrderDate]) AS orderYear FROM Products INNER JOIN (Orders INNER JOIN [Order Details] ON orders.OrderID = [Order Details].OrderID) ON Products.ProductID = [Order Details].ProductID Where orders.OrderDate Between #1/1/1997# And #12/31/1997# GROUP BY Products.ProductName, orders.CustomerID, Year([OrderDate]) PIVOT "Qtr " DatePart("q",[OrderDate],1,0) In ("Qtr 1","Qtr 2","Qtr 3","Qtr 4")
Select Customers.CustomerID, Customers.CustomerName SUM (Case When orders.Orderdate BETWEEN '01-Jan-1990' AND '31-Dec-1996' Then [UnitPrice]*[Quantity] Else 0 End) as 1997) FROM Customers INNER JOIN orders ON CustomerID=Orders.CustomerID
隐藏对象 所有的隐藏对象在数据库升级过程中都被忽略。对此,你最好的处理方法是使用程序对象的GetHiddenAttribute属性检查对象。例如,以下代码使用这一方法决定对象是否被隐藏。 Dim IsHidden As Boolean If Application.GetHiddenAttribute(objtype, objname) Then IsHidden = True End If