hey guys what i have is atm is a sgl table that i import a csv file into call tblAJLTEMP which all works fine i have even managed to import the first row which is a sales header into a table and convert the multiple date fields into 1 etc my problem lies with the rest of the data.
basically the csv file is a journal (sales data) for all registers NB i dont have control over what is exported from that as its 3rd party.
there are a series of headings
H = HEADER
D = TABLE NUMBER
C = CASHIER NUMBER
P = PRICE LEVEL
I = ITEM NUMBER (PLU)
T = TENDER TYPE (CASH/EFTPOS ETC)
R = ROUNDING
A = ACCOUNT
M = MEMBER
of which i am ok with table structure etc my problem is i need to combine multiple rows e.g the "C" line the "P" line and the "I" line into one record i think my logic which i have posted below is fine but just not sure on the code for saying do this loop for each record until next header line and how to combine the actual fields of "C","P" and "I" into one record
note this is just my logic and not actual code im not after help with all the code just an opinion on if im heading in the right direction and the functions i should be investigating for the couple of questions earlier.
thanks in advance
jason
basically the csv file is a journal (sales data) for all registers NB i dont have control over what is exported from that as its 3rd party.
there are a series of headings
H = HEADER
D = TABLE NUMBER
C = CASHIER NUMBER
P = PRICE LEVEL
I = ITEM NUMBER (PLU)
T = TENDER TYPE (CASH/EFTPOS ETC)
R = ROUNDING
A = ACCOUNT
M = MEMBER
of which i am ok with table structure etc my problem is i need to combine multiple rows e.g the "C" line the "P" line and the "I" line into one record i think my logic which i have posted below is fine but just not sure on the code for saying do this loop for each record until next header line and how to combine the actual fields of "C","P" and "I" into one record
Code:
WHERE FIELD1 = H
UNTIL FIELD1 = H AGAIN
SELECT CASE FIELD1
(THE SALESTBL CONTAINS AN AUTO NUMBER FIELD CALLED SALESID THAT I AM USING AS THE PRIMARY KEY FOR THE SALES DETAIL AND TO LINK TO ALL OTHER TABLES) CASE = H
QRYUPDSALESTBL
CASE = D
QRYUPDTABLENUMBERTBL
MAKE SALEID SAME AS SALEID IN QRYUPDSALESTBL
(NOTE ALL THE NEXT FIELDS NEED TO GO INTO ONE RECORD)
CASE = C
DO UNTIL UNTIL NEXT TIME FIELD1= C
QRYUPDCASHIERITEMSALESTBL
MAKE SALEID SAME AS SALEID IN QRYUPDSALESTBL
IF FIELD1 = P
QRYPLRICELEVELITEMSALESTBL
DO UNTIL NEXT TIME FIELD1=P
IF FIELD1 = I
QRYUPDPLUITEMSALESTBL
IF FIELD1 = S
QRYUPDSTRINGTBL
END IF (FOR THAT PRICE LEVEL)
(THERE WILL ALWAYS BE AT LEAST 2 OF THE NEXT RECORDS 1 AS TAX ONE AS MEDIA TYPE)
CASE = T
QRYUPDTENDERTBL
MAKE SALEID SAME AS SALEID IN QRYUPDSALESTBL
CASE = R
QRYROUNDINGTBL
MAKE SALEID SAME AS SALEID IN QRYUPDSALESTBL
CASE = A
QRYUPDACCOUNTTBL
MAKE SALEID SAME AS SALEID IN QRYUPDSALESTBL
CASE = M
QRYUPDMEMBERTBL
MAKE SALEID SAME AS SALEID IN QRYUPDSALESTBL
END SELECT
NEXT LOOP
END
note this is just my logic and not actual code im not after help with all the code just an opinion on if im heading in the right direction and the functions i should be investigating for the couple of questions earlier.
thanks in advance
jason