PSLine2000Documentation/Queries/LogFileQ.md

46 lines
2.0 KiB
Markdown

# LogFileQ
Analysis generated on: 4/2/2025 10:01:41 AM
---
## SQL Statement
```sql
SELECT LogFile.PN, LogFile.Action, LogFile.Tech, LogFile.TimeStamp
FROM LogFile
WHERE (((LogFile.PN)=[forms]![Process Sheet]![PartNumber]))
ORDER BY LogFile.TimeStamp;
```
## Dependencies
- [[Tables/LogFile]]
## Parameters
- [forms]![Process Sheet]![PartNumber] (Empty)
## What it does
**SQL Query Description**
==========================
### Purpose
This SQL query retrieves specific data from the `LogFile` table based on a predefined filter condition. The query fetches the `PN`, `Action`, and `Tech` columns, which correspond to Part Number, Action, and Technician respectively.
### Filter Condition
The query filters the records in the `LogFile` table where the value of the `PN` column matches the current part number specified in a predefined form ( `[forms]![Process Sheet]![PartNumber]` ). This is achieved by using an indexed lookup to directly access the values stored in this form.
### Query Steps
1. **Filtering**: The query applies the filter condition to select only those records from the `LogFile` table where the value of `PN` matches the specified part number.
2. **Data Retrieval**: The filtered records are then retrieved and returned as a result set, including the required columns (`PN`, `Action`, and `Tech`).
3. **Sorting**: Finally, the results are sorted in ascending order based on the `TimeStamp` column.
### Assumptions
* The `[forms]![Process Sheet]![PartNumber]` value is dynamically retrieved or hardcoded to represent the current part number.
* The `LogFile` table has columns `PN`, `Action`, `Tech`, and `TimeStamp`.
* The `PN` column in the `LogFile` table stores values of type integer or string, matching the data type used by the `[forms]![Process Sheet]![PartNumber]` value.
### Example Output
| PN | Action | Tech | TimeStamp |
| --- | --- | --- | --- |
This query can be useful for analyzing and monitoring log data specific to a particular part number, sorted chronologically by timestamp.