0

我们有一个内部网应用程序,它基本上可以查询一堆数据库并排列数据。它是用 ASP(我知道)编写的,在迁移到 Windows Server 2008 后,我们有一个不再填充的字段。我知道数据库连接很好,因为该页面上的所有其他内容都加载得很好。这使我相信这是该特定查询的语法问题,并且由于它使用 TO_DATE,Server 2003 和 2008 在日期格式方面可能存在一些差异。

'SQL TO PULL PROCESS GROUP
pgsql = "SELECT DISTINCT subsystem_process_group.subsystem_id, subsystem_process_group.process_group_id, "
pgsql = pgsql & "process_group.process_group_name, oncall_group_day.employee_nbr "
pgsql = pgsql & " FROM eco_admin.process_group, eco_admin.subsystem_process_group, eco_admin.oncall_group_day "
pgsql = pgsql & "WHERE ((process_group.process_group_id = subsystem_process_group.process_group_id) "
pgsql = pgsql & "AND (process_group.process_group_id = oncall_group_day.process_group_id(+)) "
pgsql = pgsql & "AND (ONCALL_GROUP_DAY.CALENDAR_DATE(+) = TO_DATE(SYSDATE)) "
pgsql = pgsql & "AND (oncall_group_day.oncall_member_role_code(+) = 'P" & hour(now) & "') "
pgsql = pgsql & "AND (subsystem_process_group.subsystem_id = " & request("id") & ")) " 

function get_name(emp_nbr)
    sql3 = "select LTRIM(RTRIM(INITCAP(COMMON_NAME))) COMMON_NAME, LTRIM(RTRIM(INITCAP(LAST_NAME))) last_name from (select EMPLOYEE_NBR,COMMON_NAME, LAST_NAME  from hrit_admin.employee union all  select   CONTRACT_RESOURCE_ID, COMMON_NAME, LAST_NAME  from   hrit_admin.contract_resource) a where employee_nbr = a.employee_nbr and employee_nbr = " & emp_nbr
    rs3.open sql3,conn
    get_name = rs3("COMMON_NAME") & " " & rs3("LAST_NAME")
    rs3.close
end function
4

0 回答 0