Query Lesson #2: Query to Excel to Access
- Open Up PeopleSoft PeopleTools
- Go,PeopleTools,Query
- File Open , Click on Name (a list of queries opens up)
- Scroll down and select XRFFLPN; double-click to open
- File, Save as, click private, desired file (query) name
- Click the Criteria tab
- Click & Drag "Field name" to right hand side of screen
- Select the Operator "Less than" to the left of the Expression
- Double click the Expression 2 column next the Field Name (looks like ' ')
- In the constant box,Type in NAAAAAAAAAAAAAA. Retrieves fieldnames A-M (50406 records. (Type one N and 17 A’s to fill in A’s to the end of the available space)
- Push "X" Excel button in top right of screen to download info to excel
- Select Enable Macros if need be
- Select enable macros again if need be
- Save in Excel as file type Microsoft Excel 97 or 2000 with
the file name of your choice
Return to Query;
Change Operator to "Greater Than"
Change "Expression 2" to MZZZZZZZZZZZZZ. Retrieves fieldnames N-Z (38496 records). (Type one M and 17 Z’s to fill in Z’s to the end of the available space)
Run to Excel and save as a different file name than the first file
Close Query
Open Microsoft Access and create a new database
Go to the Tables tab
Click on File, Get External Data, Import and select one of the two files that you previously saved.
A spreadsheet wizard will pop up, click First Row Contains Column Heading, Next, Next, Next, No Primary Key, Next, Finish, ok
Repeat # 22 & 23 with the 2nd file that you saved in Excel.
Save with a different table name than the table saved in steps 22 & 23.
Go to the Query Tab in Access
Click New, Click one of the two tables that you imported , click Add
Highlight all fields, then drag to the bottom portion of the query screen. The fields should show up in the bottom half of the screen.
Click on Query, Make Table Query, and call it "Table 1"
Click on the footprint to run the information to a new table to be called "Table 1"
Exit out of this query. (Do not save.)
Click New, Click the other table that you imported , click Add
Highlight all fields, then drag to the bottom portion of the query screen. The fields should show up in the bottom half of the screen.
Click on Query, Append Query, and select "Table 1"
Click on the footprint to append the information to a "Table 1"
You now have a complete new table (Table 1) of all information from your two tables. (Should have 88,902 records)
Query and report away!!!
Query Lesson 2: EFFECTIVE DATING
IN PSOFT QUERY
FIND FUND_TBL AND DOUBLE CLICK
SELECT NO EFFECTIVE DATE OPTION
RECORD MOVES TO QUERY TAB
DOUBLE CLICK ON FOLLOWING FIELDS TO SELECT:
FUND_CODE
EFFDT
EFF_STATUS
DESCR
RUN QUERY - VIEW RESULTS – NOTE EFFECTIVE DATES
SELECT CRITERIA TAB
CLICK AND DRAG EFFDT FROM LEFT BOX TO RIGHT BOX
Note: In order to display a variety of effetive dates, do not select Business Unit.
SELECT OPERATOR EQUAL TO
RIGHT CLICK IN EXPRESSION 2 BOX
If expression is checked, date should be entered to match output. (YYYY-MM-DD)
If constant is checked, date should be entered to match Windows system settings.
-OR- DOUBLE CLICK IN BOX BELOW EXPRESSION 2 HEADING
EDIT CONSTANT VALUE BY TYPING 02061997 IN BOX
CLICK OK (OR ENTER)
RUN QUERY – VIEW RESULTS
ONLY ONE ROW RETURNED WITH
RETURN TO CRITERIA TAB
RIGHT CLICK IN BOX BELOW EXPRESSION 2 HEADING
SELECT EXPRESSION
TYPE 1998-07-01
CLICK OK (OR ENTER)
RUN QUERY – VIEW RESULTS
RETURNS ROWS WITH 1998-07-01 DATE