Advertisement
Advertisement
| 08.21.2008 at 10:10PM PDT, ID: 23669315 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: |
CREATE PROCEDURE "ARCS"."SP_DND_EXPORT"()
AS
BEGIN
SELECT employee_id , first_name , last_name,
(IF employee.status='A' THEN 1 ELSE 2 ENDIF),
employee.emp_office_id
FROM employee, name
where (name.office_id = employee.emp_office_id)
and (name.person_id = employee.emp_person_id)
and (employee.emp_office_id in ('141','142','143','144','145','146','147','148','169','701','711','712','713','714')) --<---- parameter 1
and employee.status='A'
and employee.last_update > '2008-06-19' --<--------- parameter 2
OUTPUT TO 'c:\employees.txt' --<--------- ERROR 1
QUOTE '' ; --<------------------ ERROR 2
SELECT client_id , replace(coalesce(first_name,'nofirstname'),'"','') , replace(last_name,'"',''),
(SELECT COALESCE(MAX(Phone_number),'') from PHONE
WHERE (PHONE.office_id = client.cli_office_id)
and (PHONE.person_id = client.cli_person_id)
) as phone1,
(SELECT COALESCE(Min(Phone_number),'') from PHONE
WHERE (PHONE.office_id = client.cli_office_id)
and (PHONE.person_id = client.cli_person_id)
) as phone2,
(SELECT '') as phone3,
IF (CAST((COALESCE((select max("authorization"."frequency" * (CASE "authorization"."unit"
WHEN 'H' THEN 2
WHEN 'Q' THEN 4
WHEN 'F' THEN 1
ELSE 1 END ) * 60)
from "admission" LEFT OUTER JOIN "authorization" on admission.admission_id = authorization.admission_id
where admission.cli_office_id = client.cli_office_id and
admission.cli_person_id = client.cli_person_id and
("authorization"."begin_date" = NULL or "authorization"."begin_date" <= NOW() ) and
("authorization"."end_date" = NULL or "authorization"."end_date" >= NOW())), '' )) AS INTEGER)) = 0 then '' endif as maxhours,
8 * 60 as notificationhours,
(COALESCE((select max(DATEFORMAT("authorization"."begin_date",'MM/DD/YYYY'))
from "admission" LEFT OUTER JOIN "authorization" on admission.admission_id = authorization.admission_id
where admission.cli_office_id = client.cli_office_id and
admission.cli_person_id = client.cli_person_id and
("authorization"."begin_date" = NULL or "authorization"."begin_date" <= NOW() ) and
("authorization"."end_date" = NULL or "authorization"."end_date" >= NOW())),'01/01/2001' ))as period_start_Date,
(COALESCE((select max(DATEFORMAT("authorization"."end_date",'MM/DD/YYYY') )
from "admission" LEFT OUTER JOIN "authorization" on admission.admission_id = authorization.admission_id
where admission.cli_office_id = client.cli_office_id and
admission.cli_person_id = client.cli_person_id and
("authorization"."begin_date" = NULL or "authorization"."begin_date" <= NOW() ) and
("authorization"."end_date" = NULL or "authorization"."end_date" >= NOW())),'01/01/2016' ))as period_end_date,
(IF client.status='A' THEN 1 ELSE 2 ENDIF) as status,
'ABC' as discipline,
'0.0' as billrate,
'0.0' as payrate,
"client"."cli_office_id" as officeid,
'960' as visitlimit
FROM "name" , "client"
WHERE ( "client"."cli_office_id" = "name"."office_id" ) and
( "client"."cli_person_id" = "name"."person_id" )
and (client.cli_office_id in ('141','142','143','144','145','146','147','148','169','701','711','712','713','714')) --<---- parameter 1
and status = 1
and client.date_added > '2008-06-19' --<--------- parameter 2
OUTPUT TO 'C:\clients.txt' --<--------- ERROR 1
QUOTE ''; --<------------------ ERROR 2
END
|