|
|
|
Ошибка "Invalid operator for data type"...
|
|||
|---|---|---|---|
|
#18+
CREATE TABLE #DataCurrent (ID_Equip bigint, Date_repair smalldatetime, Type_repair char(1)) CREATE TABLE #DataMidle (ID_Equip bigint, Date_repair smalldatetime, Type_repair char(1)) CREATE TABLE #DataCapital (ID_Equip bigint, Date_repair smalldatetime, Type_repair char(1)) DECLARE @Date_beg smalldatetime, @Date_end smalldatetime, @Date_new smalldatetime, @Norm int, @days int SET @Date_beg='01.01.2003' SET @Date_end='31.12.2003' INSERT INTO #DataCurrent (#DataCurrent.ID_Equip, #DataCurrent.Date_repair, #DataCurrent.Type_repair) SELECT Equipment.ID_Equip, (Equipment.Data_kap+((@Date_beg-Equipment.Data_kap)/NormPPR.Cur_Probeg/8/Equipment.Smen)*(NormPPR.Cur_Probeg/8/Equipment.Smen)) as Date_repair, 'Т' FROM Zavod INNER JOIN Ceh ON Zavod.ID_Plnt = Ceh.ID_Plnt INNER JOIN Uchastki ON Ceh.ID_Ceh = Uchastki.ID_Ceh INNER JOIN Equipment ON Uchastki.ID_Uch = Equipment.ID_Uch INNER JOIN NormPPR ON NormPPR.ID_Equip = Equipment.ID_Equip WHERE Uchastki.Uch_name > 0 AND Uchastki.Uch_name <> 19 AND Equipment.Data_kap > '01.01.1960' AND Ceh.Ceh_name='110' AND Equipment.Smen >0 Вылетает ошибка "Invalid operator for data type." в строке: INSERT INTO #DataCurrent (#DataCurrent.ID_Equip, #DataCurrent.Date_repair, #DataCurrent.Type_repair) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.10.2002, 16:13:59 |
|
||
|
Ошибка "Invalid operator for data type"...
|
|||
|---|---|---|---|
|
#18+
Вот так с датами лучше не работать: Код: plaintext Используйте встроенные функции - DATEADD... Удачи ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.10.2002, 16:28:03 |
|
||
|
Ошибка "Invalid operator for data type"...
|
|||
|---|---|---|---|
|
#18+
Исправлюсь... спасибо, jimmers ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.10.2002, 16:39:51 |
|
||
|
Ошибка "Invalid operator for data type"...
|
|||
|---|---|---|---|
|
#18+
Исправил вот так: ... SELECT Equipment.ID_Equip, DATEADD(d,(@Date_beg-Equipment.Data_kap)/NormPPR.Cur_Probeg/8/Equipment.Smen*NormPPR.Cur_Probeg/8/Equipment.Smen,Equipment.Data_kap) as Date_repair, 'Т' ... Но все равно выходит ошибка: "Invalid operator for data type. Operator equals divide, type equals datetime." в этой строке. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.10.2002, 16:50:17 |
|
||
|
|

start [/forum/topic.php?fid=46&msg=32055215&tid=1819883]: |
0ms |
get settings: |
7ms |
get forum list: |
11ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
134ms |
get topic data: |
11ms |
get forum data: |
2ms |
get page messages: |
45ms |
get tp. blocked users: |
2ms |
| others: | 236ms |
| total: | 452ms |

| 0 / 0 |
