基于日期/月/年和序列号的自动编号,例如23112009-001 [英] Automatic numbering based on date/month/year and sequence number like this 23112009-001

查看:107
本文介绍了基于日期/月/年和序列号的自动编号,例如23112009-001的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


尊敬的专家,

有没有寻求帮助的机会?我真的很努力,在ASP.Net数据输入表单中,

我们可以根据上述条件创建新记录吗?

我有一张表Customer ,我希望客户的每条新记录都必须是这样的:IACN-23112009-001,

IACN代表今天的综合沥青客户编号"日期,即本月,今年,序列号/序列号",因此它是这样的:"IACN-2311200-001,IACN-2311200-002,依此类推,以此类推....

真的很感谢您的帮助,无论是C-Sharp或VB,对我来说并不重要,但是我最喜欢使用VB.Net 2008. p>

 

 

解决方案

您好,

我会帮助您,但在回答之前,我想澄清一些想法,我认为:

IACN :是一个静态单词,

2311200 :是插入记录的日期.

001 >: 是一天的唯一编号,第二天之后它将被重置或从001开始

这仅在数据库级别(使用存储过程)才有可能,我的意思是它不是应用程序级别的vb. net或C#.

感谢&关于
Imdad


您必须将数据发送到数据库以进行保存.在那里,您需要获取到目前为止输入的最大值,然后将其添加一个即可.您应该在数据库级别恕我直言.



< link href ="file:///C:\ DOCUME〜1 \ JHUN_C〜1 \ LOCALS〜1 \ Temp \ msohtml1 \ 01 \ clip_filelist.xml"rel =" File-List"/>< style> <!- /*样式定义*/ p.MsoNormal,li.MsoNormal,div.MsoNormal {mso-style-parent:"; 边距:0in; 底边距:.0001pt; mso分页:寡妇孤儿; 字体大小:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} 一个:链接,跨度. {color:blue; 文字装饰:下划线; text-underline:single;} A:已访问,跨度.MsoHyperlink {颜色:紫色; 文字装饰:下划线; text-underline:single;} @page Section1 {大小:8.5英寸11.0英寸; 利润:1.0英寸1.25英寸1.0英寸1.25英寸; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} -> </style> 嗨先生

Really appreciate any help, whether it is C-Sharp or VB, it doesnt matter to me, but I most preferred to use VB.Net 2008. 

 

Thanking you in advanced, Jhun Ca

 

 

Hi,

I''ll be help you, but before answered i want to clarify few thinks like and i assumed:

IACN: is a static word that will be coming in every records. 

2311200: is a date, when record was inserted. 

001:  is unique number for a day, after next day it will be reset or started from 001

this will be possible only in Database level (using stored procedure), i mean it is not an application level nither vb.net nor C#. 

Thanks & Regards,
Imdad


You must be sending the data to the database for saving. There you need to get the maximum value entered so far and just add one to it. You should be doing this at the database level IMHO.



<link href="file:///C:\DOCUME~1\JHUN_C~1\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml" rel="File-List" /><style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline; text-underline:single;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style>Hi Mr. Sunasara Imdadhusen,  Good evening Sir!

Regarding to your answer::

I''ll be help you, but before answered i want to clarify few thinks like and i assumed:

IACN: is a static word that will be coming in every records. 

        -Yes IACN is a static word, that would come every new records inserted in the Customer Table, Let say,  

Company Name               Customer Number

Widget Company            IACN-2311200-0001

ACME Company              IACN-2311200-0002

Stone and Textiles         IACN-2311200-0003

This is regardless of date, the sequence number must be continued regardless of months or date as it is still in the year 2009, Once the year changed then sequence number must be also change or reset into 0001       

 

2311200: is a date, when record was inserted. 

              -Yes absolutely correct.

001:  is unique number for a day, after next day it will be reset or started from 001

       As I said before, sequence number must be continued till the end of the year, and once the year finished then sequence number must also reset. 

Please help me....

this will be possible only in Database level (using stored procedure), i mean it is not an application level nither vb.net nor C#.

Thanks & Regards,
Imdad


这篇关于基于日期/月/年和序列号的自动编号,例如23112009-001的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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