Post Pacific  

Go Back   Post Pacific > Lineage 2 Russian > Сервер
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 14.01.2007, 06:12   #1
Firefly
Архивный участник
 
Join Date: Aug 2006
Posts: 56
Default SetLastTaxUpdate

Error sql: EXEC lin_SetLastTaxUpdate '2007-0-2 12:0:57', '2007-0-2 0:0:54', '2007-0-2 20:0:2' (0)
Error 42000:[Microsoft][ODBC SQL Server Driver][SQL Server]Error converting data type varchar to datetime.
[.\Socket.cpp][12448] cannot update last tax change date.


Народ некто не сталкивался с такой ошибкой в [Cachede]

/en/ Plz help to correct this mistake, has already bothered
Firefly is offline  
Old 14.01.2007, 07:20   #2
sys[antaris]
Архивный участник
 
Join Date: May 2005
Posts: 73
Default

Обрати внимание на месяц, он нулевой, добавляй в процедуре +1 к месяцу и все будет нормально.
sys[antaris] is offline  
Old 14.01.2007, 09:56   #3
SnowDragon
Архивный участник
 
Join Date: Dec 2006
Posts: 27
Default

может подскажите как? =) а то в скуле не силен...
или сцылочку на какую-нибудь статейку по этой теме =)))
SnowDragon is offline  
Old 14.01.2007, 11:31   #4
mono
Архивный участник
 
Join Date: Dec 2006
Posts: 16
Default

чтото типа такого, не тестил...
ALTER PROCEDURE dbo.lin_SetLastTaxUpdate
(
@income varchar(100),
@tax varchar(100),
@manor varchar(100)
)
AS

declare @income_ datetime
declare @tax_ datetime
declare @manor_ datetime

set @income =left(@income,5) + cast((cast(replace(substring(@income,6,2),'-','') as int) + 1) as varchar) + substring(@income, charindex ('-', @income, 6),100)
set @tax =left(@tax,5) + cast((cast(replace(substring(@tax,6,2),'-','') as int) + 1) as varchar) + substring(@tax, charindex ('-', @tax, 6),100)
set @manor =left(@manor,5) + cast((cast(replace(substring(@manor,6,2),'-','') as int) + 1) as varchar) + substring(@tax, charindex ('-', @tax, 6),100)

set @income_ = convert(datetime, @income)
set @tax_ = convert(datetime, @tax)
set @manor_ = convert(datetime, @manor)


SET NOCOUNT ON
IF EXISTS(SELECT * FROM castle_tax)
BEGIN
UPDATE castle_tax SET income_update = @income_, tax_change = @tax_, manor_reset = @manor_
END
ELSE
BEGIN
INSERT INTO castle_tax VALUES
( @income_, @tax_, @manor_)

END
mono is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 22:32.