Difference between revisions of "Helpful Queries"
Jump to navigation
Jump to search
m |
m |
||
Line 9: | Line 9: | ||
{| class = "wikitable" | {| class = "wikitable" | ||
|- | |- | ||
− | | | + | |Start and End Lease total Inventories. |
|<syntaxhighlight lang="SQL"> | |<syntaxhighlight lang="SQL"> | ||
#TOTAL 5 6 | #TOTAL 5 6 | ||
---------------------------- | ---------------------------- | ||
− | --Change these parameters | + | --Change these parameters: |
#DEFINE :AGR='The Lease #' | #DEFINE :AGR='The Lease #' | ||
#DEFINE :PDT='mm/dd/yyyy' | #DEFINE :PDT='mm/dd/yyyy' | ||
Line 31: | Line 31: | ||
ORDER BY s.user_ref, prod_date | ORDER BY s.user_ref, prod_date | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | | | + | | |
|- | |- | ||
|} | |} |
Revision as of 15:16, 27 February 2020
This page contains queries that have been found useful for Prams users.
◄ QueryX2
To use one of the queries below, copy all the data and paste into QueryX2, change the parameters, then run the query.
If you are having difficulties running a query or need a new query built, call Prams at 303-904-6855.
Start and End Lease total Inventories. | #TOTAL 5 6
----------------------------
--Change these parameters:
#DEFINE :AGR='The Lease #'
#DEFINE :PDT='mm/dd/yyyy'
----------------------------
SELECT s.user_ref, p.name,md.prod_date, md.start_bal, md.end_bal
FROM md_product md
LEFT JOIN site s ON md.site_id = s.site_id
LEFT JOIN product p On md.product_id = p.product_id
WHERE md.product_id IN
(SELECT product_id FROM product
WHERE site_id = md.site_id AND [type] = 'OIL' AND name = 'OIL' )
AND s.[site_type] IN ('WEL')
AND md.prod_date >= :PDT
AND s.site_id IN (SELECT site_id FROM site_agree WHERE [value] = :AGR)
ORDER BY s.user_ref, prod_date |
Copyright © 2024 by PRAMS Plus LLC. All Rights Reserved.