本文介绍了如何在插入发票时生成发票号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好, 我为发票创建了一个asp页面, 我必须在之前生成发票#插入。 例如,创建发票表格:
Hi guys, I have created one asp page for invoice, where i have to generate invoice no# before insertion. for eg, creating invoice form:
Date:__________ Invoice# 10012 Item:__________ Description:__________ Qty:__________Remarks:__________ 'Save'每个新发票,我必须自动增加'发票#'。 怎么做, plzzz帮助/建议我。 谢谢。
on every new invoice, i have to auto increment the 'invoice#'. how to do that, plzzz help/suggest me. thanks.
推荐答案解决方案: 如果您的表名是InvoiceTbl 就像这样做 1.使InvioceNo列与身份相同(1,1) 2.运行此查询以获取下一个号码: Solution: Like if your table name is InvoiceTbl than do this 1. Make InvioceNo column identical like identity(1, 1) 2. Run this query to get next number: SELECT Max(InvoiceNo) FROM InvoiceTbl
这将返回最大发票号码。 2.在返回的号码上加一(+1)。 3. ave新记录
This will return you max invoice number. 2. Add One (+1) to the returned number. 3. ave the new record
定义字段对于发票中没有作为自动增量的SQL: www.w3schools /sql/sql_autoincrement.asp [ ^ ] Define the field for invoice no in the SQL as auto-increment: www.w3schools/sql/sql_autoincrement.asp[^]
为您的发票表单添加发票号,您可以将其添加到表单的左上角或右上角(例如)。为新发票生成新发票否,您可以创建一个字符串,其中包含数字和字母,每次点击创建发票按钮,您都可以生成新发票,其中包含显示发票类型(买入,卖出或其他)的字母和可以随机创建或订购的数字。 for adding a invoice no for your invoice form you can add it to top-left or top-right of your form(for example). for generating new invoice no for your new invoice you can create a string that has numbers and letters that with every click on create invoice button you can generate new invoice no that has a letter that show invoice type(buy,sell or other) and a number that can created randomly or with order.
更多推荐
如何在插入发票时生成发票号
发布评论