FAQ - Useful Query Examples for the LVS-95XX Software

Modified on Mon, 21 Apr at 2:25 PM



Q: What are some examples of queries I can use as templates?


A: Software commands using SQL language can be used in the "Query" box at the bottom of the Archive Tab to run specific reports.




 The examples below can be used as templates with your specific information substituted.


Query on the Reference field and Date (last 30 days) sorted by Date (Newest to Oldest)

Select ReportID, SectorID, LclTime, Reference, OverallGrade, DecodedText From Reports Where Reference="9580-KLS" AND LclTime >= #2019-10-02 16:26:38# Order By LclTime DESC


Query on the DecodedText field and Date (last 30 days) sorted by Date newest to oldest

Select ReportID, SectorID, LclTime, Reference, OverallGrade, DecodedText From Reports Where DecodedText="RGT23244037" AND LclTime >= #2019-10-02 16:31:55# Order By LclTime DESC


Query (DecodedText field and Date range) sorted by Date (Newest to Oldest)

Select ReportID, SectorID, LclTime, Reference, OverallGrade, DecodedText From Reports Where DecodedText="012345678905" AND LclTime BETWEEN #2019-11-01 16:31:55# AND #2019-01-01 16:31:55# Order By LclTime DESC


Or sorted by ReportID (Descending)

Select ReportID, SectorID, LclTime, Reference, OverallGrade, DecodedText From Reports Where DecodedText="012345678905" AND LclTime BETWEEN #2019-11-01 16:31:55# AND #2019-01-01 16:31:55# Order By ReportID DESC


This works also if you don’t want to specify the time of day.

Select ReportID, SectorID, LclTime, Reference, OverallGrade, DecodedText From Reports Where DecodedText="012345678905" AND LclTime BETWEEN #2019-11-01# AND #2019-01-01# Order By ReportID DESC


Query covering data from November 1, 2019 back to November 1, 2018 is:

Select ReportID, SectorID, LclTime, Reference, OverallGrade, DecodedText From Reports Where DecodedText= "12345678" and LclTime>=#2018-11-01# Order By ReportID



JOINING TWO DATA TABLES Example


Report joining two data tables for filtering by Reference (Report table) and Additional reference (Report.Data table)

Select Reports.ReportID, SectorID, LclTime, Reference, ReportData.ParameterValue as AddtionalReference, OverallGrade,DecodedText From Reports INNER JOIN ReportData ON Reports.ReportID = ReportData.ReportID Where ReportData.ParameterName = "Additional reference" AND ReportData.ParameterValue="xxx" AND Reports.Reference ="xxx" Order By Reports.ReportID




Date/Revision History

First review 4/21/2025 V1.0


Author:

Brian Keenan, Technical Support Specialist


References

84-9310006-02 Appendix G

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article