Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Below is a script I have been writing to combine four 1 xlx and 3 SQL files to produce a QVD file.
The load portions work just fine. When I get to picking the fields I want to create a QVD file, the script says it cannot find the table.
I would appreciate help in finding the correct syntax for this.
//********************Facility Load******************
Facility_Id:
LOAD FacilityId,
A_FAC_NAME as F_NAME ,
A_FTYPE ,
A_REG
FROM
(biff, embedded labels, table is Sheet1$);
//********************Insurance Load**********************
ODBC CONNECT TO MeditechDREH;
Insurance:
Load
InsuranceID,
Name as INS_NAME;
SQL SELECT *
FROM LiveEH.dbo.DMisInsurance;
//******************Visit Information*************************
ODBC CONNECT TO MeditechDREH;
Visits:
Load
AdmitDateTime,
DischargeDateTime as Disch_Date,
interval(num(DischargeDateTime)-num(AdmitDateTime)) as LOS,
PatientID as ACCT_NUM,
FacilityName & PrimaryInsuranceID as FAC_INS,
FacilityName,
PrimaryInsuranceID as InsuranceID,
FacilityName as FacilityId,
InpatientOrOutpatient,
Month(DischargeDateTime) as Month,
Year(DischargeDateTime) as Year,
VisitID as MT_VISIT;
SQL SELECT *
FROM LiveEH.dbo.BarVisits
Where InpatientOrOutpatient='I';
//***************************Patient Financial Info*******************
Fin_Data:
Load
AdjustmentTotal,
Balance as BAL,
BarStatus,
ChargeTotal as CHARGES,
ReceiptTotal as RECEIPTS,
RefundTotal as REFUNDS,
VisitID as MT_VISIT;
SQL SELECT *
FROM LiveEH.dbo.BarVisitFinancialData
WHERE (Balance=0 and BarStatus='FB'and ChargeTotal<>0) or (BarStatus='BD' and ChargeTotal<>0);
//**********************Create QVD************************************
Vist_Data:
Buffer(Incremental)
Load
F_NAME,
A_FTYPE,
A_REG;
Sql Select *
From Facility_Id;
Load
InsuranceID,
INS_NAME;
Sql Select *
From Insurance;
Load
LOS,
FAC_INS,
ACCT_NUM,
Disch_Date,
InsuranceID;
Sql Select *
From Visits;
Load
BAL,
CHARGES,
RECEIPTS,
REFUNDS,
MT_VISIT;
Sql Select *
From Fin_Data;
store Visit_Data into C:\Documents and Settings\gxpowers\MyDocuments\Meditech_Data.qvd;
Drop Table Visit_Data;
Thanks
Glen
Hello, Glen.
I think that you created a small mistake in table name:
Vist_Data:
Buffer(Incremental)...
but you try to store a table with name Visit_Data.
I think you missed one symbol and you should use script like this:
Visit_Data:
Buffer(Incremental)
I changed the table name from Vsit_Data to Visit_Data. However, I am still getting the error message:
Invalid Object Name: Facility_Id
Sql Select *
From Facility_Id
Do I need to make the "source" tables Resident?
Thanks
Glen
Hi,
Store statement can only export fields from one logical table. So you'll have to create only one table. You can try using joins or resident tables to merge all the fields into one large table. But then you need to have some common feilds between these tables to join them.