Sunday, March 18, 2012

Sub Account - SO Slip Printing Problem


use subaccounts
declare @qry varchar(200)
declare @mydt varchar(6)
set @mydt =
case when day(getdate())>9 then convert(varchar(2),day(getdate())) else '0' + convert(varchar(2),day(getdate())) end +
case when month(getdate())>9 then convert(varchar(2),month(getdate())) else '0' + convert(varchar(2),month(getdate())) end +
right(convert(varchar(4),year(getdate())),2)
print @mydt
if not exists (select * from syscolumns where id=(select id from sysobjects where type='U' and name='soslip' + @mydt) and name='cashsent3')
begin
set @qry='set nocount on alter table soslip' + @mydt + ' add cashsent3 money not null default 0'
exec (@qry)
set @qry = 'set nocount on alter table soslip' + @mydt + ' add remittancedetails3 varchar(8000) not null default ''' + ''''
exec (@qry)
end

No comments:

Post a Comment