snoopy80
Technical User
- Jun 27, 2001
- 106
I have an Access query that I am having difficulty to convert it to SQL view. Here is the Access03 Query:
SELECT qryOrder.ID, qryOrder.PatientOwes, qryOrder.DOS, Now()-[dos] AS data, IIf([ALLOWED]=0,[totalbilled]-[priminsurancepaid]-[secinsurancepaid]-[patientpaid]-[adjustmentamount],[ALLOWED]-[priminsurancepaid]-[secinsurancepaid]-[patientpaid]-[adjustmentamount]) AS ar, qryOrder.HCFA, qryOrder.[Item#], qryOrder.DatePaid, tblPatient.DATEUC1, tblPatient.DATEUC1, tblPatient.DATEUC1, tblPatient.DATEUC1, tblPatient.DATEUC1, tblPatient.DATEUC1, tblPatient.DATEUC1, tblPatient.DATEUC1, tblPatient.DATEUC1
FROM qryOrder INNER JOIN tblPatient ON qryOrder.ID = tblPatient.ID
WHERE ((Not (qryOrder.DOS) Is Null And (qryOrder.DOS)<=Now()) AND ((IIf([ALLOWED]=0,[totalbilled]-[priminsurancepaid]-[secinsurancepaid]-[patientpaid]-[adjustmentamount],[ALLOWED]-[priminsurancepaid]-[secinsurancepaid]-[patientpaid]-[adjustmentamount]))>0));
Can someone help me to convert this to SQL 2005 view
SELECT qryOrder.ID, qryOrder.PatientOwes, qryOrder.DOS, Now()-[dos] AS data, IIf([ALLOWED]=0,[totalbilled]-[priminsurancepaid]-[secinsurancepaid]-[patientpaid]-[adjustmentamount],[ALLOWED]-[priminsurancepaid]-[secinsurancepaid]-[patientpaid]-[adjustmentamount]) AS ar, qryOrder.HCFA, qryOrder.[Item#], qryOrder.DatePaid, tblPatient.DATEUC1, tblPatient.DATEUC1, tblPatient.DATEUC1, tblPatient.DATEUC1, tblPatient.DATEUC1, tblPatient.DATEUC1, tblPatient.DATEUC1, tblPatient.DATEUC1, tblPatient.DATEUC1
FROM qryOrder INNER JOIN tblPatient ON qryOrder.ID = tblPatient.ID
WHERE ((Not (qryOrder.DOS) Is Null And (qryOrder.DOS)<=Now()) AND ((IIf([ALLOWED]=0,[totalbilled]-[priminsurancepaid]-[secinsurancepaid]-[patientpaid]-[adjustmentamount],[ALLOWED]-[priminsurancepaid]-[secinsurancepaid]-[patientpaid]-[adjustmentamount]))>0));
Can someone help me to convert this to SQL 2005 view