D
dvgrhl
I hope this makes sense:
I need to have a query that allows the user to define a criteria from a
list, rather than an input box. Currently, tbl_Building has entries
stored in it that I want to be able to select from a list for this
query. For sake of the example, let's call them Building A, Building
B, and Building C.
I have this query set to run and return results between the dates the
user inputs, then by the building inputed, but I need the variable
"Building Name" to be a list from the tbl_Building rather than an input
box where the user has to know exactly the names of the buildings.
SELECT tbl_Work_Order_Info.Building, tbl_Work_Order_Info.Initial_Date,
tbl_Work_Order_Info.[Date Project Started],
=DATEDIFF("d",tbl_Work_Order_Info.Initial_Date,tbl_Work_Order_Info.[Date
Project Started]) AS Expr1, tbl_Work_Order_Info.[Date Project
Completed], =DATEDIFF("d",tbl_Work_Order_Info.[Date Project
Started],tbl_Work_Order_Info.[Date Project Completed]) AS Expr2,
=DATEDIFF("d",tbl_Work_Order_Info.Initial_Date,tbl_Work_Order_Info.[Date
Project Completed]) AS Expr3
FROM tbl_Work_Order_Info
WHERE ((tbl_Work_Order_Info.Initial_Date)>=[Start Date]) And
((tbl_Work_Order_Info.Initial_Date)<=[End Date]) And
((tbl_Work_Order_Info.Building)=[Building Name])
ORDER BY tbl_Work_Order_Info.Building,
tbl_Work_Order_Info.Initial_Date;
Any ideas how to accomplish this? Thanks.
I need to have a query that allows the user to define a criteria from a
list, rather than an input box. Currently, tbl_Building has entries
stored in it that I want to be able to select from a list for this
query. For sake of the example, let's call them Building A, Building
B, and Building C.
I have this query set to run and return results between the dates the
user inputs, then by the building inputed, but I need the variable
"Building Name" to be a list from the tbl_Building rather than an input
box where the user has to know exactly the names of the buildings.
SELECT tbl_Work_Order_Info.Building, tbl_Work_Order_Info.Initial_Date,
tbl_Work_Order_Info.[Date Project Started],
=DATEDIFF("d",tbl_Work_Order_Info.Initial_Date,tbl_Work_Order_Info.[Date
Project Started]) AS Expr1, tbl_Work_Order_Info.[Date Project
Completed], =DATEDIFF("d",tbl_Work_Order_Info.[Date Project
Started],tbl_Work_Order_Info.[Date Project Completed]) AS Expr2,
=DATEDIFF("d",tbl_Work_Order_Info.Initial_Date,tbl_Work_Order_Info.[Date
Project Completed]) AS Expr3
FROM tbl_Work_Order_Info
WHERE ((tbl_Work_Order_Info.Initial_Date)>=[Start Date]) And
((tbl_Work_Order_Info.Initial_Date)<=[End Date]) And
((tbl_Work_Order_Info.Building)=[Building Name])
ORDER BY tbl_Work_Order_Info.Building,
tbl_Work_Order_Info.Initial_Date;
Any ideas how to accomplish this? Thanks.