calandrelli
Technical User
I have an table linked into my SQL Server 2000 database. The linked table contains manufacturing transactions from our mainframe. One field JOB_ACTY_DT is a date field and another field JOB_ACTY_TM is a vchar field that contains a time in 24 hour serial format. I want to create a view that combines these two fields into one date time value named JOB_DATE_T.
For example....
JOB_ACTY_DT JOB_ACT_TM JOB_DATE_T
------------------------------------------------------
11/22/1992 12:00 am 1135 11/22/1992 11:35 am
11/22/1992 12:00 am 835 11/22/1992 08:35 am
11/22/1992 12:00 am 1315 11/22/1992 01:15 pm
I have managed to do it using the following script but this is a large table and this script takes a long time to execute. Can anyone think of a different approach?
CREATE View calancs.qry_IDEA_Job_Linked as
Select DateAdd(hh,(Cast(Left(JOB_ACTY_TM,Len(JOB_ACTY_TM)-2)as Int)), DateAdd(n,Cast(Right(JOB_ACTY_TM,2)as Int),JOB_ACTY_DT)) Job_Date_T,
From OPENQUERY(addiw1, 'select *from IDEA.AMM_JOB_ACTY ')
For example....
JOB_ACTY_DT JOB_ACT_TM JOB_DATE_T
------------------------------------------------------
11/22/1992 12:00 am 1135 11/22/1992 11:35 am
11/22/1992 12:00 am 835 11/22/1992 08:35 am
11/22/1992 12:00 am 1315 11/22/1992 01:15 pm
I have managed to do it using the following script but this is a large table and this script takes a long time to execute. Can anyone think of a different approach?
CREATE View calancs.qry_IDEA_Job_Linked as
Select DateAdd(hh,(Cast(Left(JOB_ACTY_TM,Len(JOB_ACTY_TM)-2)as Int)), DateAdd(n,Cast(Right(JOB_ACTY_TM,2)as Int),JOB_ACTY_DT)) Job_Date_T,
From OPENQUERY(addiw1, 'select *from IDEA.AMM_JOB_ACTY ')