Most Excellent Queries

From KeystoneIntranet
Revision as of 13:00, 14 July 2023 by WikiAdmin (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Reporting

Inventory

Inventory Valuation
Inventory Turnover Report Query
Inventory Reconciliation Report Queries
Verify Product Cost Rollup
Product Structure Cost Analysis

General Ledger

GL Trial Balance Query
GL Trial Balance by Group Query
GL All Transactions Related to an Account

Payroll

Dispatch

Query/Export Dispatch Reports Examples with DIP_TICKETHISTORY - Start Here!
Pour Time Variance Actual vs. Target

GPS

GPTSTATUS

select * from gptstatus
where truck_no='74' order by seq_no desc
rows 1 to 100

GPS with description:

select gps.truck_no , status_datetime,
case status_col
when 0 then 'Unknown'
when 1 then 'Beg Load'
when 2 then 'End Load'
when 3 then 'To Job'
when 4 then 'On Job'
when 5 then 'Beg Pour'
when 6 then 'End Pour'
when 7 then 'Returning'
when 8 then 'At Plant'
when 9 then 'In Serv'
when 10 then 'Out of Serv'
when 11 then 'Trk Clock In'
when 12 then 'Trk Clock Out'
when 13 then 'Travel'
when 14 then 'Pre-Ticket'
when 15 then 'Drv Clock In'
when 16 then 'Drv Clock Out'
end,
case status_reason
when 0 then 'GPS Data'
when 1 then 'Manual Status'
when 2 then ' Auto Status'
when 3 then 'On-job based on stop time'
when 4 then 'On-job based on button'
when 5 then 'Loaded based on batch results received'
when 6 then 'Pre-ticketed load released'
when 7 then 'Geofence entered/exited'
else '???' end Reason
,gps.*
from gptstatus gps 
where gps.status_datetime between :"Begin" and :"End"
-- and gps.truck_no = '105' 
and status_col ^= 13


GPS with Ticket Info

select gps.truck_no gpstrk,pth.truck_no ptk_trk, status_datetime,
case status_col
when 0 then 'Unknown'
when 1 then 'Beg Load'
when 2 then 'End Load'
when 3 then 'To Job'
when 4 then 'On Job'
when 5 then 'Beg Pour'
when 6 then 'End Pour'
when 7 then 'Returning'
when 8 then 'At Plant'
when 9 then 'In Serv'
when 10 then 'Out of Serv'
when 11 then 'Trk Clock In'
when 12 then 'Trk Clock Out'
when 13 then 'Travel'
when 14 then 'Pre-Ticket'
when 15 then 'Drv Clock In'
when 16 then 'Drv Clock Out'
end,
case status_reason
when 0 then 'GPS Data'
when 1 then 'Manual Status'
when 2 then ' Auto Status'
when 3 then 'On-job based on stop time'
when 4 then 'On-job based on button'
when 5 then 'Loaded based on batch results received'
when 6 then 'Pre-ticketed load released'
when 7 then 'Geofence entered/exited'
else '???' end Reason,pth.cust_no,pth.ticket_no
,gps.*
from gptstatus gps 
left outer join artptkhd pth on pth.order_session_no=gps.order_session_no and pth.order_trans_no=gps.order_trans_no and gps.load_no=pth.order_load_no
where gps.status_datetime between :"Begin" and :"End"
-- and gps.truck_no = '105' 
and status_col ^= 13

STATUS_COL values:

1 Begin Load
2 End Load
3 Leave Plant
4 Arrive Job
5 Begin Pour
6 End Pour
7 Leave Job
8 Arrive Plant
9 In Service
10 Out of Service
11 Clock In
12 Clock Out
13 GPS Data
14 Pre-Ticket


STATUS_REASON values:

0 GPS Data
1 Manual Status
2 Auto Status
3 On-job based on stop time
4 On-job based on button
5 Loaded based on batch results received
6 Pre-ticketed load released
7 Geofence entered/exited

Diagnostic

Accounts Payable

A/P Balancing Queries

Accounts Receivable and Billing

Product Setup

Product Structure: Identify U/M Mismatches


Cash Posting Related

DataScope: Cash Posting Detail Quick Fix
Identify Cash Header mismatches Cash Detail
DataScope: Match G/L Activity to Cash Posting Detail by Session / Date
AR Balancing - Accounts Receivable Balance to General Ledger
AR DIAG: Payments in Prior Period than Invoice Date
AR Cash Detail Invoice Date Mismatch
DataScope: A/R G/L transactions by Source - Quick summary view of all a/r transactions in g/l.

Sales Tax

Keystone 2.2 Sales Tax Conversion Diagnostics

Search Terms

AR Balancing Balance Crossover

Inventory

Identify Infinite Recursion in Product Structure
Identify and Fix Products With No Standard Cost Records
Identify Product Cost Rollup Failed Due to Unit of Measure Mismatch
Identify and Fix bad Transaction Times
Identify Assembly and Component Product Reconcile Group Mismatch

General Ledger

G/L Balancing Queries
G/L Year End Diagnostic Queries

Payroll

Dispatch

Projected Load Analysis for Demand Graph
Dispatch Schedule Query
Dispatch Diagnostic Query Collection
Dispatch Time Diagnostics

System

Security Report Queries
Security - Options by Users Query / Report

Update

Accounts Receiveable and Billing

AR: Fix Leading/Trailing Spaces in Jobs (09/23/2020)
AR: Replicate Products Update Query
AR: Update Product Classes in Sales Detail
Time Fix Queries
AR: Update Sales Costs from Product Standard Cost

Inventory

Product Structure Replication Query

General Ledger

Delete GLTFSDEF Records for Missing Groups
Delete Unused Groups

Payroll

Payroll: Update Value from one Def_ID to another
Payroll: Set Pension Flag to Y/N based on activity for a specific Def_ID

Dispatch

Time Fix Queries
Dispatch: Update Undeliverd Load to a Deliverd Load
Resend Order Complete Emails