如果错误输入任何日期 [英] Iif false enter any date

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

问题描述

亲爱的,


我正在使用结核病数据库。如果患者没有肺结核,那么我希望术语不适用。出现在日期诊断变量中。但如果他们确实患有结核病,我希望能够在诊断日期框中输入任何日期。我一直在使用IIf函数来获取不适用的内容,但我无法找到如何输入任何日期。你能帮忙吗?


祝福路易斯


PS。所以我有一个带有二元结核变量(1或0)的表,在同一个表中是另一个具有诊断日期的变量。我正在写一个表格来输入这个表格的数据。当我在结核病栏中输入0时,我希望术语不适用。自动在诊断日期变量的表中输入。这有助于更好地解释吗?


但是如果我在表格上输入结核变量1,那么我希望能够将他们被诊断出的日期添加到日期诊断框上形成。很抱歉没有详细说明。

Dear All,

I''m working with a tuberculosis database. If patients don''t have tuberculosis then I want the term "not applicable" to appear in the date diagnosed variable. But if they do have tuberculosis I want to be able to enter any date into the date diagnosed box. I''ve been using the IIf function to get the not applicable to appear, but I cant find out how to enter any date. Could you help?

Best wishes Louis

PS. So I have a table with a binary tuberculosis variable (1 or 0), within the same table is another variable with the diagnostic date. I''m working on a form to enter data to this table. When I enter 0 in the tuberculosis column I want the term "not applicable" to automatically be entered in the table in the diagnostic date variable. Does that help explain better?

But If I enter 1 on the form to the tuberculosis variable I want to then be able to add whichever date they were diagnosed to the date diagnosed box on the form. Sorry not to have explained in sufficient detail.

推荐答案

你是什么意思日期诊断变量?


您是指您存储此信息的表,用于显示数据的表单或报表,还是VBA中的实际变量?这些都是非常不同的东西。


Pat
What do you mean by "date diagnosed variable"?

Are you referring to the table that you store this information in, the form or report that you use to display the data, or an actual variable in VBA? These are all very different things.

Pat


这解释得好一点。在继续之前获得语义是非常重要的。对程序员来说,术语变量是指程序员。具有与表格没有直接关系的特定含义。这就是我要求澄清的原因。

安排像这样的表的标准方法是有一个日期列,其中每个记录都有该列的条目,或者没有条目。条目的存在或不存在使得位类型列冗余,因此将仅消除位列。如果适用,您不会在日期列中存储除日期之外的任何内容。


在您显示数据的表单和/或报告中,如果您想显示数据;不适用没有约会的时候,你当然可以这样做。使用该日期列作为条件查询表并查明是否存在条目(例如, SELECT ... FROM ... WHERE date IS NULL )。


采用这种方法,你可以简化表格并简化使用表格的查询。
That explains it a little better. It''s always important to get the semantics correct before proceeding. To a programmer, the term "variable" has a specific meaning that doesn''t directly relate to tables. That''s why I asked for clarification.

The standard way to arrange a table like this is to have a date column where each record either has an entry for that column, or does not have an entry. The existence or non-existence of an entry makes the bit typed column redundant, and so the bit column would just be eliminated. You would not store anything in the date column other than a date, if applicable.

On the form and/or reports where you display the data, if you want to have it show "not applicable" when there is no date, you can certainly do so. It''s a simple matter to query the table using that date column as criteria and finding out whether there''s an entry or not (for instance, SELECT ... FROM ... WHERE date IS NULL).

In taking this approach, you simplify your table and simplify the queries that use the table.


好的,谢谢你的's有帮助,但它提出了另一个问题。部分问题是确保正确输入数据。因此,或许不是自动输入不适用,我应该制定一个规则,如果结核病是1(即患者患有结核病),那么必须用日期填写该方框而不留空白。我应该怎么做呢?真的很感谢你对此的帮助。


我想它几乎就像只说相应的结核病项为1时诊断日期是必填项。
OK thanks that''s helpful but it sort of raises another question. Part of the problem is to ensure that the data is entered correctly. So perhaps then rather than automatically enter not applicable, I should make a rule that if tuberculosis is 1 (i.e. the patient has tuberculosis) then the box must be filled in with a date and not left blank. How therefore should I do this? Really appreciate your help with this.

I suppose it''s almost like saying the date diagnosed entry is a required field ONLY IF the corresponding tuberculosis entry is 1.


这篇关于如果错误输入任何日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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