ms-access - Trouble with using a form to search multiple dates in Access and return a query
问题描述
So I've got a customer that has the need to search multiple dates on an appointment. I've created a form that has inputs set up to capture one of the dates and returns a query based on the dates entered.
This is the table design:
This is what the form looks like
Submitting the form runs this query
SELECT PersonType.Category, Person.FirstName, Person.LastName, Person.DOB, Pet.Name, Pet.Microchip, Appointment.Cost, Appointment.AppointmentDate, Appointment.[Respite In], Appointment.[Respite Out], Appointment.[Rehome In], Appointment.[Rehome Out], Appointment.[In Date], Appointment.[Out Date], Appointment.[Service Location], Appointment.Note
FROM ((PersonType
INNER JOIN Person ON PersonType.PersonTypeId = Person.PersonTypeID) INNER JOIN Pet ON Person.PersonID = Pet.PersonID)
INNER JOIN Appointment ON (Pet.ID = Appointment.PetID) AND (Person.PersonID = Appointment.PersonID)
WHERE (((Appointment.AppointmentDate)>=[Forms]![Search Appointment Dates]![AppointmentDate] And (Appointment.AppointmentDate)<=[Forms]![Search Appointment Dates]![AppointmentEnd]) OR ((Appointment.[Respite In]) = [Forms]![Search Appointment Dates]![RespiteIn]) OR ((Appointment.[Respite Out]) = [Forms]![Search Appointment Dates]![RespiteOut]) OR ((Appointment.[Rehome In]) = [Forms]![Search Appointment Dates]![RehomeIn]) OR ((Appointment.[Rehome Out]) = [Forms]![Search Appointment Dates]![RehomeOut]) OR ((Appointment.[In Date]) = [Forms]![Search Appointment Dates]![InDate]) OR ((Appointment.[Out Date]) = [Forms]![Search Appointment Dates]![OutDate]));
Running the query from the form results in a 3270 error and attempting to open the query itself brings up the following error. To this point this has been more frustrating than I anticipated and I'm not sure why this is happening or how to get this to work successfully.
解决方案
推荐阅读
- php - 我的 WooCommerce 功能都不起作用
- javascript - 我正在尝试在控制台中打印道具,但是当我编写 console.log(props.details) 时,它会在控制台中打印两次
- python-3.x - 尝试使用“%%timeit”获取单元执行时间,但输出“`未找到”。
- c++ - 读取用户输入会导致分段错误,但硬编码时输入不同
- javascript - Tabulator JS - 如何在用户输入时验证数字字段
- amazon-web-services - 通过 Athena 将 AWS S3 中的 CSV 合并到更大的 GZIP 文件中
- python - 在 Google 表格上使用 Gspread 识别单元格位置的问题
- algorithm - 算法运行时上限的缩放告诉您什么?
- java - 为什么我的随机数组在 0.001 秒内排序?
- android-studio - 在最后一个 gradle 版本中无法解析 android studio 中的 jitpack 依赖项