查询结果错误 [英] Query result error

查看:78
本文介绍了查询结果错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ftp:/ /ukcassassin:winston@www.ukcass...ary%20Form.bmp

大家好

我会提前为我的缺乏而道歉访问及其工作的知识,因为我对该程序很新,并且已经自学了,所以这里有。


正如你可以通过图像链接看到的我正在创建一个约会一个车库的日记,它一直很好,直到我创造了小时剩余文本框主要子窗体将预订的小时数相加,并在预订的小时数中显示它们。文本框,这很好用。子表单Techs Absent基于检查假期表的查询。具有技术ID,名称,假日开始日期和假日开始日期。 ,假日结束日期和可预订时间。在它的领域。基本上,它检查在日历控件上选择的日期是> = hol开始日期和< =假日结束日期,如果是,它显示技术名称及其在此子表单中的可预订小时数(不确定是否清除)实时显示在日历控件中选择的每个日期,并向我显示在该特定日期关闭的人员以及他们的价值。 (希望你和我在一起......哈哈)IE:如果缺少技术,他的预定时间必须从当天的总时数中扣除,通常为26


总小时数对于4个技术人员来说是26个小时,我的问题是我根据剩余时间记录来源。值为26小时的文本框减去预订总时数值,减去可预订时间的总和。 Techs缺席子表单中的字段。当Techs缺席子表单时,这种方法正常工作。显示一个值,但是当所选日期没有技术缺席时,查询在子表单中显示没有结果,并且剩余小时数表示没有结果。文本框显示ERROR。有没有办法继续进行计算,即使查询结果没有显示价值?


我知道它很长,很可能很混乱,但你的帮助会非常受欢迎

非常感谢提前

Chris

ftp://ukcassassin:winston@www.ukcass...ary%20Form.bmp

Hi all
I will appologise in advance for my lack of knowledge of access and its working as i am quite new to the program and have been self taught, so here goes.

As you can see by the image link i am creating an appointment diary for a garage,its going ok untill i created the "Hours remaing" text box The main subform adds up the hours booked in and displays them in the "Hours Booked" text box, this works fine. The Subform "Techs Absent" is based on a query that checks a "holiday table" that has a "Tech ID","Name","Holiday Start Date" , "Holiday End Date"and "Bookable Hours" field in it. Basically it checks the date selected on the calender control is >= the hol start date and <= the holiday end date and if so it displays the tech names and their bookable hours in this subform (not sure if thats clear) this runs realtime with each date selected in the calender control and shows me who is off on that particular day and how many hours they are worth. (hope your still with me...lol) I.E: if a tech is absent his bookable hours must be deducted from the total hours for that day which is normally 26

The total hours for the 4 techs is 26 hours, and my problem is that i based the record source for the "Hours Remaing" text box on a value of "26 hours" minus the "Total Hours Booked" value, Minus the sum of the "Bookable Hours" field in the Techs absent subform. This works fine when the "Techs absent subform" shows a value but when there are no techs absent on the date selected , the query shows no results in the subform and the "Hours Remaining" text box shows ERROR. Is there a way to still do the calculation even if the query result shows no value?

I know it was long winded and probably very confusing but your help would be so much appreciated
Many thanks in advance
Chris

推荐答案




我难道我不能更加困惑,我理解你的文本的10%(我的头部被中途扭曲)但我认为它应该在查询的条件字段中使用IF句子。这样你可以告诉你的查询如果在abcent字段中有一个值就进行计算,否则它只是跳过计算。


我急着工作但是希望这有点帮助
Hi

I couldn''t me more confused, I understood about 10% of your text (my head gets twisted halfway) but I think it should work with an IF sentence in the criteria field of your query. In that way you could tell your query to do the calculation if there is a value in the abcent field otherwise it just skips the calculation.

I''m in a hurry for work but hopefully this helps a bit



4个技术人员的总小时数是26小时,我的问题是我基于记录源小时剩余值为26小时的文本框减去预订总时数值,减去可预订时间的总和。 Techs缺席子表单中的字段。当Techs缺席子表单时,这种方法正常工作。显示一个值,但是当所选日期没有技术缺席时,查询在子表单中显示没有结果,并且剩余小时数表示没有结果。文本框显示ERROR。有没有办法继续进行计算,即使查询结果没有显示价值?


我知道它很长,很可能很混乱,但你的帮助会非常受欢迎

非常感谢提前

Chris
The total hours for the 4 techs is 26 hours, and my problem is that i based the record source for the "Hours Remaing" text box on a value of "26 hours" minus the "Total Hours Booked" value, Minus the sum of the "Bookable Hours" field in the Techs absent subform. This works fine when the "Techs absent subform" shows a value but when there are no techs absent on the date selected , the query shows no results in the subform and the "Hours Remaining" text box shows ERROR. Is there a way to still do the calculation even if the query result shows no value?

I know it was long winded and probably very confusing but your help would be so much appreciated
Many thanks in advance
Chris



您必须更改''减去可预订的总和小时"技术领域缺少子表单''

You will have to change ''Minus the sum of the "Bookable Hours" field in the Techs absent subform'' to

展开 | 选择 | Wrap | 行号


...或者简写为:
...Or the shorthand for that is :
展开 | 选择 | Wrap | 行号


这篇关于查询结果错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆