在ERP中定义用户时报错:SqlDateTime 溢出。必须介于 1/1/1753 12:00:00 AM 和 12/31/9999 11:59:59 PM 之间

时间:2021-05-05 03:39:55

在ERP中定义用户时。

 

报错:

SqlDateTime 溢出。必须介于 1/1/1753 12:00:00 AM 和 12/31/9999 11:59:59 PM 之间。

在ERP中定义用户时报错:SqlDateTime 溢出。必须介于 1/1/1753 12:00:00 AM 和 12/31/9999 11:59:59 PM 之间

原因分析:

①没有正确初始化系统面板:可能是初始化时没有选择对期间,设置时跳过了这一步。

②也可能是数据库级的操作。(这种情况不多见)

解决方案:

期间生成语句

If(Not Exists(Select * From AAFinYe Tm Where Tm.AbsID = 2017))
INSERT INTO [AAFinYe] ([AbsID],[AbsName],[AbsCategory],[AbsActive],[Ref_SDate],[Ref_EDate],[Ref_Locked],[GL_SDate],[GL_EDate],[GL_Locked],[Tax_SDate],[Tax_EDate],[Tax_Locked],[SubNum],[SubType],[PeriodNum],[IsClose])
VALUES ('','',NULL,'Y','2017/1/1 0:00:00','2017/12/31 0:00:00',NULL,NULL,NULL,'N',NULL,NULL,NULL,10,NULL,NULL,'N') INSERT INTO [AAFin] ([AbsID],[AbsName],[AbsCategory],[AbsActive],[Ref_SDate],[Ref_EDate],[Ref_Locked],[GL_SDate],[GL_EDate],[GL_Locked],[Tax_SDate],[Tax_EDate],[Tax_Locked],[SubNum],[SubType],[PeriodNum],[IsClose],[Batch_Locked],[Sale_Locked])
VALUES ('','','','Y','2017/1/1 0:00:00','2017/1/31 0:00:00','N',NULL,NULL,'N',NULL,NULL,'N',1,'M',0,'N','N','N')
INSERT INTO [AAFin] ([AbsID],[AbsName],[AbsCategory],[AbsActive],[Ref_SDate],[Ref_EDate],[Ref_Locked],[GL_SDate],[GL_EDate],[GL_Locked],[Tax_SDate],[Tax_EDate],[Tax_Locked],[SubNum],[SubType],[PeriodNum],[IsClose],[Batch_Locked],[Sale_Locked])
VALUES ('','','','Y','2017/2/1 0:00:00','2017/2/28 0:00:00','N',NULL,NULL,'N',NULL,NULL,'N',2,'M',0,'N','N','N')
INSERT INTO [AAFin] ([AbsID],[AbsName],[AbsCategory],[AbsActive],[Ref_SDate],[Ref_EDate],[Ref_Locked],[GL_SDate],[GL_EDate],[GL_Locked],[Tax_SDate],[Tax_EDate],[Tax_Locked],[SubNum],[SubType],[PeriodNum],[IsClose],[Batch_Locked],[Sale_Locked])
VALUES ('','','','Y','2017/3/1 0:00:00','2017/3/31 0:00:00','N',NULL,NULL,'N',NULL,NULL,'N',3,'M',0,'N','N','N')
INSERT INTO [AAFin] ([AbsID],[AbsName],[AbsCategory],[AbsActive],[Ref_SDate],[Ref_EDate],[Ref_Locked],[GL_SDate],[GL_EDate],[GL_Locked],[Tax_SDate],[Tax_EDate],[Tax_Locked],[SubNum],[SubType],[PeriodNum],[IsClose],[Batch_Locked],[Sale_Locked])
VALUES ('','','','Y','2017/4/1 0:00:00','2017/4/30 0:00:00','N',NULL,NULL,'N',NULL,NULL,'N',4,'M',0,'N','N','N')
INSERT INTO [AAFin] ([AbsID],[AbsName],[AbsCategory],[AbsActive],[Ref_SDate],[Ref_EDate],[Ref_Locked],[GL_SDate],[GL_EDate],[GL_Locked],[Tax_SDate],[Tax_EDate],[Tax_Locked],[SubNum],[SubType],[PeriodNum],[IsClose],[Batch_Locked],[Sale_Locked])
VALUES ('','','','Y','2017/5/1 0:00:00','2017/5/31 0:00:00','N',NULL,NULL,'N',NULL,NULL,'N',5,'M',0,'N','N','N')
INSERT INTO [AAFin] ([AbsID],[AbsName],[AbsCategory],[AbsActive],[Ref_SDate],[Ref_EDate],[Ref_Locked],[GL_SDate],[GL_EDate],[GL_Locked],[Tax_SDate],[Tax_EDate],[Tax_Locked],[SubNum],[SubType],[PeriodNum],[IsClose],[Batch_Locked],[Sale_Locked])
VALUES ('','','','Y','2017/6/1 0:00:00','2017/6/30 0:00:00','N',NULL,NULL,'N',NULL,NULL,'N',6,'M',0,'N','N','N')
INSERT INTO [AAFin] ([AbsID],[AbsName],[AbsCategory],[AbsActive],[Ref_SDate],[Ref_EDate],[Ref_Locked],[GL_SDate],[GL_EDate],[GL_Locked],[Tax_SDate],[Tax_EDate],[Tax_Locked],[SubNum],[SubType],[PeriodNum],[IsClose],[Batch_Locked],[Sale_Locked])
VALUES ('','','','Y','2017/7/1 0:00:00','2017/7/31 0:00:00','N',NULL,NULL,'N',NULL,NULL,'N',7,'M',0,'N','N','N')
INSERT INTO [AAFin] ([AbsID],[AbsName],[AbsCategory],[AbsActive],[Ref_SDate],[Ref_EDate],[Ref_Locked],[GL_SDate],[GL_EDate],[GL_Locked],[Tax_SDate],[Tax_EDate],[Tax_Locked],[SubNum],[SubType],[PeriodNum],[IsClose],[Batch_Locked],[Sale_Locked])
VALUES ('','','','Y','2017/8/1 0:00:00','2017/8/31 0:00:00','N',NULL,NULL,'N',NULL,NULL,'N',8,'M',0,'N','N','N')
INSERT INTO [AAFin] ([AbsID],[AbsName],[AbsCategory],[AbsActive],[Ref_SDate],[Ref_EDate],[Ref_Locked],[GL_SDate],[GL_EDate],[GL_Locked],[Tax_SDate],[Tax_EDate],[Tax_Locked],[SubNum],[SubType],[PeriodNum],[IsClose],[Batch_Locked],[Sale_Locked])
VALUES ('','','','Y','2017/9/1 0:00:00','2017/9/30 0:00:00','N',NULL,NULL,'N',NULL,NULL,'N',9,'M',0,'N','N','N')
INSERT INTO [AAFin] ([AbsID],[AbsName],[AbsCategory],[AbsActive],[Ref_SDate],[Ref_EDate],[Ref_Locked],[GL_SDate],[GL_EDate],[GL_Locked],[Tax_SDate],[Tax_EDate],[Tax_Locked],[SubNum],[SubType],[PeriodNum],[IsClose],[Batch_Locked],[Sale_Locked])
VALUES ('','','','Y','2017/10/1 0:00:00','2017/10/31 0:00:00','N',NULL,NULL,'N',NULL,NULL,'N',10,'M',0,'N','N','N')
INSERT INTO [AAFin] ([AbsID],[AbsName],[AbsCategory],[AbsActive],[Ref_SDate],[Ref_EDate],[Ref_Locked],[GL_SDate],[GL_EDate],[GL_Locked],[Tax_SDate],[Tax_EDate],[Tax_Locked],[SubNum],[SubType],[PeriodNum],[IsClose],[Batch_Locked],[Sale_Locked])
VALUES ('','','','Y','2017/11/1 0:00:00','2017/11/30 0:00:00','N',NULL,NULL,'N',NULL,NULL,'N',11,'M',0,'N','N','N')
INSERT INTO [AAFin] ([AbsID],[AbsName],[AbsCategory],[AbsActive],[Ref_SDate],[Ref_EDate],[Ref_Locked],[GL_SDate],[GL_EDate],[GL_Locked],[Tax_SDate],[Tax_EDate],[Tax_Locked],[SubNum],[SubType],[PeriodNum],[IsClose],[Batch_Locked],[Sale_Locked])
VALUES ('','','','Y','2017/12/1 0:00:00','2017/12/31 0:00:00','N',NULL,NULL,'N',NULL,NULL,'N',12,'M',0,'N','N','N')

但是这时候期间已经关闭了,怎么办呢?

退出AIO5系统,下载【期间生成语句】——到数据库执行【期间生成语句】——然后再执行一下这个语句【Update AAAdm set IsStart = 'N'】 ——打开AIO5服务器(重新启动下)——再次打开AIO5系统,即可选择正确的期间。