Hi guys, i have purchases table where purchase items are selected and a daily purchase report generated. i use SQL to select item ID and Date of purchase then sum all the daily purchases.
since i have multiple items with unique IDs,like 'B001' FOR COCA-COLA, 'F001' FOR Fanta and so on, i would like When i select an item e.g 'B001' the name should also appear in some field after pressing run instead of only totals so that i can have 'fanta opening stock'or 'coca-cola opening stock' based on my input. the folloing is my current SQL query.
currently i only get two fiedls[number of purchase] and [opening stock] i want item ID and Name to also appear on the query. thanks
since i have multiple items with unique IDs,like 'B001' FOR COCA-COLA, 'F001' FOR Fanta and so on, i would like When i select an item e.g 'B001' the name should also appear in some field after pressing run instead of only totals so that i can have 'fanta opening stock'or 'coca-cola opening stock' based on my input. the folloing is my current SQL query.
Code:
SELECT Count(*) AS [NUMBER OF PURCHASES], Sum([UNITS PURCHASED]) AS [OPENING STOCK] FROM PURCHASES WHERE (((PURCHASES.[Item ID]) Like [ENTER ITEM CODE:] & "*") AND ((PURCHASES.[Date Purchased]) Like [ENTER DATE OF PURCHASE:] & "*"));
Comment