Hello,
I'm looking for a better approach to this problem and would welcome any guidance.
I work with different data each week, the data contains mostly similar fields though the field names are always different, ie. Invoice-Date versus Inv-Date. Some data includes a Freight column while other data does not, etc.
Here is an example of everything I'm provided with.
Company Info:
Exam # = 34
CurrDate = 02/03/2005
ID = 9878
Exam Type = 554
Reason-Q = From Run
Tax-Code = 24
Loc-Code = 0000-00000-0000
Reason-A = Tax Paid
Det-Avg = D
T-Rate = 7%
Comments = None
Data Layout
Invoice-Date
Vendor Name
Description
Amount
Inv-Num
Freight
Sundry
Service
I need to create a query that generates a file that must be in the format below based on the Company Info and the Data Layout. In this example, I would want to bring in Freight as Num-1, Sundry as Num-2 and Service as Num-3. Also, again please notice that the Field Names in the Export Layout are different than the Data Layout Name, ie. INV-DATE versus Invoice-Date. Thanks
Export Data Layout
Field Name
EXAM#
SYS-DATE
AUD-ID
EXAM-TYPE
INV-DATE
INVOICE-#
NAME
DESC
REASON-Q
TAX-CODE
LOC-CODE
Amount
DET-AVG
T-RATE
CHAR-1
CHAR-2
CHAR-3
CHAR-4
CHAR-5
NUM-1
NUM-2
NUM-3
NUM-4
NUM-5
I'm looking for a better approach to this problem and would welcome any guidance.
I work with different data each week, the data contains mostly similar fields though the field names are always different, ie. Invoice-Date versus Inv-Date. Some data includes a Freight column while other data does not, etc.
Here is an example of everything I'm provided with.
Company Info:
Exam # = 34
CurrDate = 02/03/2005
ID = 9878
Exam Type = 554
Reason-Q = From Run
Tax-Code = 24
Loc-Code = 0000-00000-0000
Reason-A = Tax Paid
Det-Avg = D
T-Rate = 7%
Comments = None
Data Layout
Invoice-Date
Vendor Name
Description
Amount
Inv-Num
Freight
Sundry
Service
I need to create a query that generates a file that must be in the format below based on the Company Info and the Data Layout. In this example, I would want to bring in Freight as Num-1, Sundry as Num-2 and Service as Num-3. Also, again please notice that the Field Names in the Export Layout are different than the Data Layout Name, ie. INV-DATE versus Invoice-Date. Thanks
Export Data Layout
Field Name
EXAM#
SYS-DATE
AUD-ID
EXAM-TYPE
INV-DATE
INVOICE-#
NAME
DESC
REASON-Q
TAX-CODE
LOC-CODE
Amount
DET-AVG
T-RATE
CHAR-1
CHAR-2
CHAR-3
CHAR-4
CHAR-5
NUM-1
NUM-2
NUM-3
NUM-4
NUM-5