如何获得发票号码 [英] How to get invoice number
本文介绍了如何获得发票号码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道如何从下面的查询中获取发票号码
i want to know how to get invoice number from below query
SET @InvoiceNo='Final/' + (CASE WHEN @month <= 3 THEN CAST((@year-1) AS VARCHAR) ELSE CAST(@year AS VARCHAR) END) +'-' + (CASE WHEN @month <= 3 THEN CAST(((@year)%2000) AS VARCHAR) ELSE CAST(((@year+1)%2000) AS VARCHAR) END)+'/'+ CONVERT(VARCHAR(10),@CurrentNo)
print @InvoiceNo
i面对这个查询的问题我得到空值,请帮忙...
我的尝试:
i facing a problem with this query i am getting null value, pls someone help...
What I have tried:
how to get invoice number
推荐答案
把它拿到哪里?它在@InvoiceNo变量中,所以如果你想使用它另一个查询
Get it where? It's in the @InvoiceNo variable so if you want to use it another query
select @InvoiceNo as InvoiceNo, othefield FROM sometable
如果你只是想自己归还它
if you just want to return it as a result on its own
select @InvoiceNo as InvoiceNo
这篇关于如何获得发票号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文