SELECT
IIf(Weekday([CODetails].[Date]-[PrepAdj])=1,[CODetails].[Date]-[PrepAdj]-2,IIf(Weekday([CODetails].[Date]-[PrepAdj])=7,[CODetails].[Date]-[PrepAdj]-1,[CODetails].[Date]-[PrepAdj]))
AS PrepDate, IIf([List Order]=10,[Vegitarians],[StudentCount]) AS Count2,
Customers.Vegitarians, PackSheetItems.[List order], PSJoinTable.PSItemID,
CustomerOrders.COID, CustomerOrders.CustomerID, CountTable.Division,
CountTable.Subdivison, CountTable.StudentCount, CustomerOrders.MealType,
CustomerOrders.ServingType, CustomerOrders.Month, CustomerOrders.Year,
CODetails.Date, CODetDet.MenuItemID, PackSheetItems.PSIPortion,
PackSheetItems.PSUOM, PackSheetItems.Department,
IIf(Weekday([CODetails].[Date]-[DelAdj])=1,[CODetails].[Date]-[DelAdj]-2,IIf(Weekday([CODetails].[Date]-[DelAdj])=7,[CODetails].[Date]-[DelAdj]-1,[CODetails].[Date]-[DelAdj])) AS DelDate, Weekday([CODetails].[Date]) AS Weekday
FROM (MenuItems INNER JOIN ((Customers INNER JOIN (CustomerOrders INNER JOIN
(CODetails INNER JOIN CountTable ON CODetails.CODetID = CountTable.CODetID)
ON CustomerOrders.COID = CODetails.COID) ON Customers.CustomerID =
CustomerOrders.CustomerID) INNER JOIN CODetDet ON CODetails.CODetID =
CODetDet.CODetID) ON MenuItems.MenuItemID = CODetDet.MenuItemID) INNER JOIN
(PackSheetItems INNER JOIN PSJoinTable ON PackSheetItems.PSItemID =
PSJoinTable.PSItemID) ON MenuItems.MenuItemID = PSJoinTable.MenuItemID
WHERE
(((IIf(Weekday([CODetails].[Date]-[PrepAdj])=1,[CODetails].[Date]-[PrepAdj]-2,IIf(Weekday([CODetails].[Date]-[PrepAdj])=7,[CODetails].[Date]-[PrepAdj]-1,[CODetails].[Date]-[PrepAdj])))=[Forms]![ReportInformation]![Text0]));
When I type the date criteria directly into the query, I get the all the
data for that date. If I ask the query to get the data form the form I get
no data at all. I can cut and past the request for data into a non
calculated field and I get the data for that date.
I hope this is the information that you need. Thanks for you help.
--
menube
Duane Hookom said:
Can you provide the SQL view of the query with the criteria from the form?
Can you tell us what you mean by "it does not work" which tells us almost
nothing?
--
Duane Hookom
Microsoft Access MVP
:
I have a delivery date field in my query that is calculated. When I type the
criteria directly into the query exp. #10/20/08# everything works fine. If I
use a form to retrive the criteria it does not work. The problem only occurs
with the calcualted field. I'm new at this so I'm sure I'm missing
something. Any help would be appreciated.