在午夜重置LoadNumber计数 [英] Resetting a LoadNumber count at midnight

查看:136
本文介绍了在午夜重置LoadNumber计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据库,其中有一个LoadNumber字段,当前是一个下拉列表。我想用计数器自动化这个。不过,我需要在每晚的午夜将计数器重置为1。我知道我需要将日期设置为变量,然后添加一个计数器以向LoadNumber添加+1,循环直到午夜,然后将日期重置为新日期。我只是不知道我需要的确切代码。我使用Windows XP和Access 2003.


谢谢

I have a database that has a LoadNumber field that currently is a drop down list. I would like to automate this with a counter. I need the counter to reset to 1 at midnight every night, though. I know that I need to set the date as a variable and then add a counter to add +1 to the LoadNumber with a loop til midnight, then reset the date to the new date. I just do not know the exact code that I need. I use Windows XP and Access 2003.

Thanks

推荐答案

我怀疑你没有想到正确的路线总的来说。


从概念上讲,您应该通过查询表来查找所有与当前日期相匹配的记录的Max()使用数字(并且显然加一个。


这有意义吗?
I suspect you''re not thinking along the right lines at all.

Conceptually, you should be looking at working out the new number by querying the table to find the Max() used number for all records that match the date of today (and adding one obviously).

Does that make sense?



我怀疑你''根本不考虑正确的方向。


从概念上讲,你应该通过查询表来查找所有记录的Max()使用数字来查找新数字。匹配今天的日期(并明显添加一个)。


这有意义吗?
I suspect you''re not thinking along the right lines at all.

Conceptually, you should be looking at working out the new number by querying the table to find the Max() used number for all records that match the date of today (and adding one obviously).

Does that make sense?



我不确定我明白这一点。让我清楚一下我需要什么(尽管你可能完全正确)。我有一个永远不会超过40的负载数。无论它达到什么数字,我都必须在午夜重置为1(一旦日期改变)。


谢谢求助!

I''m not sure I understand that. Let me clearify what I need (you may be exactly right though). I have a load number that should never get above about 40. Whatever number it reaches, I have to have it reset to 1 at midnight (as soon as the date changes).

thanks for the help!



我不确定我理解。让我清楚一下我需要什么(尽管你可能完全正确)。我有一个永远不会超过40的负载数。无论它达到什么数字,我都必须在午夜重置为1(一旦日期改变)。


谢谢寻求帮助!
I''m not sure I understand that. Let me clearify what I need (you may be exactly right though). I have a load number that should never get above about 40. Whatever number it reaches, I have to have it reset to 1 at midnight (as soon as the date changes).

thanks for the help!



想想你在问什么!你是否真的希望在午夜重置负载号,或者你是否怀疑,希望在新的一天输入的第一条记录从1开始。这是一个如何为此编码解决方案的主要区别。


Don

Think about what you are asking! Do you realy want the load number to reset at midnight or, do you as I suspect, want the first record entered on a new day to start at 1. It''s a major difference in how one would go about coding a solution for this.

Don


这篇关于在午夜重置LoadNumber计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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