I am using SSIS to import data from an Access database created by another department. It is weekly data, and one column is named [weeknum]_Sales - where each week the name of this column changes (201810_Sales, 201811_Sales, etc.) I am mapping that column (by position) to column in my db (Sales) but I need to put "weeknum" in another column.
Basically, their database is aggregating sales by item, and has this week's total (table has all items but only one week), but my db has years of data.
Their table (in Access)
Store, UPC, Sales, Units.....
My table:
Store, WeekNum, UPC, Sales, Units....
So I need to "retrieve" the left 6 characters of column name of column 3 (or 4) to a variable or expression before the SSIS Dataflow runs, and set column 3 of my table to that value for all rows inserted.
I know how to set the the destination column to a literal, expression or variable - but I don't know the specifics of how to get the column's name at run time of the SSIS package.
Thanks,
Related
I am trying to create a View using certain fields from a single MYSQL table. But in one of the fields in the Table, I need to populate the field from either one field in the table or another field in the same table based on the value of a third field in the table. Is this possible, and if so, how?
To explain, The table contains data from two suppliers. The entries in the table from "Supplier A" store the Account Number in field CustomerNumber while the entries in the table from "Supplier B" store the Account Number in field CustomerAcct. The view I need to generate needs to list all of the customer orders from both suppliers combined, and populate a single field in the view called AccountNumber with either the value from CustoomerNumber or CustomerAcct, depending on which supplier filled the order.
Is this possible?
You'd use the "case" function, as in mysql case
CASE
WHEN Supplier = 'A' THEN customernumber
ELSE customeraccount
END as accountnumber
I have 2 queries.
The first query is from the webi universe which has:
Staff ID
Arrival Date
Leave Date
The 2nd query is an Excel data query that has:
Staff ID
Test Date
What I am want to do is to create a single table that has:
Staff ID
Arrival Date
Leave Date
Test Date
How can I do that?
Create two data providers. First Data Provider using Universe will select Staff ID, Arrival Date, Leave Date. Second Data Provider using Excel Data Source will select Staff ID, Test Date. Run the queries. Once the data is fetched. Merge the common column (Staff ID). Then create a new table and drag the columns as required.
So I have an Access database that I'm trying to build and was wondering was there a way that if I type in an ID into one table that it can populate values in the adjacent column from another table.
For example I have table_1 that has columns User ID and User Number.
And now that I'm creating table_2 I want when I enter the User Number that it populates the value for another column which will be User ID, sort of how a vlookup would work in excel.
I already built a relationship for the User Number column in table_2 so when I type in the value its pulling from table_1. But I can't get column User ID to populate with the corresponding value. Thanks
You don't need to build a second table that duplicates the data. Since you already have it in table 1 you can always refer to that relationship when querying data and should do so in order to avoid discrepancies between the two tables. In this instance if you want to return the user id from table 1 when you specify a user number you should just create a new query using the sql code:
SELECT table_1.[User Number], table_1.[User ID]
FROM table_1
WHERE table_1.[User Number] IN (12345, 12346, 12347);
In this example, the 12345, 12346, 12347 represent your user numbers for which ID's you were wanting to return; so you should only replace those values with your search parameters.
I have four dimension tables named Branch, Product, Supplier and Time. I am taking all primary keys from these tables namely b_id, p_id, s_id and quarter_id to create my fact table. And I am adding another attribute named total sell based on another table named Customer_Bill which has quantity.
I want to create the fact table with data such that I get values for all the fields.
e.g. 1st branch with 3rd supplier sold 5th product in 2nd quarter and the amount is 34.
can anyone please help?
i have 2 tables:
Employee:
ID
SalaryPerDay
Name (unique)
.....
.....
Schedule:
ID
EmployeeID
Date
Attending (boolean)
loan
discount
overTimeHours
and a query
EmployeeNameQuery: that return all employees names
i create a datasheet contains
column 1: employees names (EmployeeNameQuery)
column 2: Date (Schedule)
column 3: Attening (Schedule)
column 1: OverTimeHours (Schedule)
column 4: Loan (Schedule)
column 5: Discount (Schedule)
this data sheet display rows as employees names count
Questions:
1- Decimal number display as (280) how can i display them as (280.00) i can insert decimal number but i display values with .00 without .00
2- How to create form that contain data from 2 tables and save data to one table,
when i fill all datasheet with attending i want to submit these information to Schedule Table with each field with related one in the table and insert EmployeeID of selected employeeName.
In regard to both one and two, it seems that you have not bound your form to a table or query. Datasheets and continuous forms only work properly if all the data-entry controls are bound to fields. It is nearly always best to use a continuous form rather than a datasheet. If you are not familiar with form design, it is nearly always best to use the wizards, because they will set up the form with all the bindings in place.
For currency, choose the currency data type, not decimal - this is important for more than display. In addition, fields have a format property that can be set in table design.
I suggest you do some reading if you intend to continue to work in Access. You will find lists of books here on Stackoverflow - The Access Cookbook Getz, Litwin and Baron is often recommended.