保存日期时间并减少数字 [英] save datetime and inscrease numbers
问题描述
我有一些关于日期时间的问题。我想保存一个数据库,通过访问来写ID,例如:yymm ####
yy;年份获得两个数字(2008) - > 08
mm:月份获得两个数字 - > 02
####:订单:0001,0002
整个功能:08020001
当我保存一个客户时,Id增加08020002,...,08020010 ......
但是再增加一个月08030001,08030002,... 。,08030010 ..
继续这样下去
和年增加(2009):09010001,.. 09010010
请帮忙我要这样做
非常感谢
问候。
Hoang Phuc
< blockquote>
我有一些关于日期时间的问题。我想通过访问ID来保存数据库,例如:yymm ####
yy;年份获得两个数字(2008年) - > 08
mm:月份获得两个数字 - > 02
####:订单:0001, 0002
整个功能n:08020001
当我保存一个客户时,Id增加08020002,...,08020010 ...
但是再增加一个月08030001,08030002,... 。,08030010 ..
继续这样下去
和年增加(2009):09010001,.. 09010010
请帮忙我这样做
非常感谢
问候。
Hoang Phuc
您好,
您是说每个月要将客户号码重置回0001?所以两个月ID的例子可能是:
08020001,08020002,08030001,08030002,08030003?
博士B
正确!
你能告诉我这样做,或者你知道另一个写我同样代码的页面。
非常感谢你的帮助
如果你帮助我我很开心
你好phuc2583,
这是一个可以基于代码的工作示例(Example.asp)。我不知道你正在使用什么类型的数据库所以我只是在Access中做了(让我知道你是否需要数据库的副本)。
首先,数据库有六个字段所有文本字段但是?KeyId?字段是自动编号字段。记录的示例可能如下所示:
KeyId = 392
CustomerYear = 08
CustomerMonth = 02 >
CustomerNumber = 5
客户姓名= Billy Bob Smith
CustomerID = 08020005
这是代码。
Example.asp
展开 | 选择 | Wrap | 行号
I have some problem about the date time.I want to save a database with write by access that ID such as:yymm####
yy;year get two numbers(2008)->08
mm:month get two numbers->02
####:the order:0001,0002
the whole function:08020001
when i save a customer that,Id increase 08020002,...,08020010...
but step another month that increase 08030001,08030002,...,08030010..
and go on like that
and also the year increase(2009) :09010001,..09010010
Please help me to do that
thanks so much
Regards.
Hoang Phuc解决方案I have some problem about the date time.I want to save a database with write by access that ID such as:yymm####
yy;year get two numbers(2008)->08
mm:month get two numbers->02
####:the order:0001,0002
the whole function:08020001
when i save a customer that,Id increase 08020002,...,08020010...
but step another month that increase 08030001,08030002,...,08030010..
and go on like that
and also the year increase(2009) :09010001,..09010010
Please help me to do that
thanks so much
Regards.
Hoang PhucHi there,
Do you mean that each month you want to reset the customer number back to 0001? So an example of two months worth of ID''s might be:
08020001, 08020002, 08030001, 08030002, 08030003 ?
Dr B
Correctly!
Can you show me to do that or you know another the page that write the same of my code.
Thank you so much to your help
I am very fun if you help me
Hello phuc2583,
Here is one working example (Example.asp) that you could base your code on. I did not know what type of database that you are using so I just did it in Access (let me know if you want a copy of the database).
First the database has six fields all text fields but the ?KeyId? field that is an auto numbering field. An example of a record could look like this:
KeyId = 392
CustomerYear = 08
CustomerMonth = 02
CustomerNumber = 5
CustomerName = Billy Bob Smith
CustomerID = 08020005
Here is the code.
Example.asp
Expand|Select|Wrap|Line Numbers
这篇关于保存日期时间并减少数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文