搜索表单以提取两个数字之间的值的记录 [英] Search form to pull up records with values between two numbers

查看:62
本文介绍了搜索表单以提取两个数字之间的值的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我正在开发一个包含大量字段的搜索表单的数据库应用程序。一切正常,直到我试图设置它来拉取两个数字之间的值的记录。这些数字是年份,但字段不是日期格式,只是普通的整数格式。表中的字段称为ActiveDate,搜索表单具有numActiveFrom和numActiveTo。我似乎无法获得运行它的代码,我无法弄清楚该死的东西有什么问题。文本字段都可以正常工作,但不是上面指定的数字字段。下面是与该字段相关的代码。我也包括前面的位和后面的位用于上下文。任何帮助将非常感谢。如果您需要任何其他详细信息,请告诉我。

Okay, so I''m working on a database application with a search form that covers a ton of fields. And everything worked fine, until I tried to set it to pull records that have a value between two numbers. These numbers are years, but the fields aren''t in a date format, just a normal integer format. The field in the table is called ActiveDate, and the search form has numActiveFrom and numActiveTo. I can''t seem to get the code to run it, and I can''t figure out what''s wrong with the damned thing. The text fields all work fine, but not the number fields specified above. Below is the bit of code that relates to this field. I''m also including the bit just before and the bit just after it for context. Any help would be very much appreciated. Please let me know if you need any other details.

展开 | 选择 | Wrap | 行号

推荐答案

如果全部字段是整数,问题是你需要删除#从你的代码。除非您使用日期/时间字段,否则不要使用#分隔符。


Jim
If all the fields are integers, the problem is you need to remove the "#" from your code. You don''t use the # delimiter unless you are working with date/time fields.

Jim


假设您的[From]和[ To] Fields表示年份(整数),然后一般语法将是:

从字段到字段的最后一天的第一天,即:
Assuming your [From] and [To] Fields represent Years (Integers), then the General Syntax would be:
The 1st Day of the from Field to the Last Day of the To Field, namely:
展开 | 选择 | Wrap | 行号


jimatqsi,我尝试使用与''相同的代码,因为我已经完成了我的其他字段,但它没有然后工作。还有什么我应该做的吗?


ADezii,我尝试使用你提供的代码(当然有适当的改编)。但是当我尝试运行搜索时,它告诉我没有适合搜索的记录,无论我输入什么年份。此外,即使此人仅进入开始年份,或者他们只进入结束年份,我也需要搜索表单才能工作。几年前我做了类似的事情(我真的不习惯这个),但它是日期字段,而不是普通数字字段,所以代码不能完全正确翻译。


非常感谢你们帮助,伙计们,但是我还没有到那里去。还有其他建议吗?
jimatqsi, I tried using the same code with the '' instead, as I''ve done with my other fields, but it didn''t work then either. Is there something else I should be doing?

ADezii, I tried using the code you provided (with the proper adaptations, of course). But when I try to run a search it tells me there are no records that fit the search, no matter what years I enter. Also, I need the search form to work even if the person only enters the start year, or if they only enter the end year. I did something similar to this several years ago (I''m really out of practice with this), but it was with date fields, not plain number fields, so the code doesn''t translate across quite right.

Thanks so much for trying to help, guys, but I''m just not quite there yet. Any other suggestions?


这篇关于搜索表单以提取两个数字之间的值的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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