Notification

Icon
Error

Only show string right of character N

Posted: Monday, January 20, 2020 10:00:08 PM(UTC)
STRiCT

STRiCT

Member Original PosterPosts: 7
0
Like
I have a SubQuery (SubQuery1.Value) that produces the string 'Windows 10 Enterprise v1903', however I only want 1903 to show in the report.

Quote:
SubQuery1.Value As Image


Any assistance would be appreciated!
RC62N
#1RC62N Member Posts: 425  
posted: 1/20/2020 10:36:12 PM(UTC)
Take a look at the SQL string functions.

In particular, you should be able to use CharIndex() to find your fingerprint/preceding text and then Right() and Len() to isolate the rest of the string.

e.g.
Code:
SELECT Right(SubQuery1.Value, Len(SubQuery1.Value) - CharIndex('e v',  SubQuery1.Value) - 2)
Given your source text as example,
Code:
Windows 10 Enterprise v1903
....:....1....:....2....:..

Code:
Len(SubQuery1.Value)
returns 27, the length of the source text.
Code:
SELECT CharIndex('e v',  SubQuery1.Value)
returns 21, the position of the "e" where "e v" was found.

You want to everything to the right of that "e" plus the next two characters, space and "v", so Len() - CharIndex() - 2.

Active Discussions

Action PowerShell - Top 10 Memory Hogs
by  iamBaphomet   Go to last post Go to first unread
Last post: Today at 3:00:53 PM(UTC)
Lansweeper Launch TeamViewer from inside LanSweeper
by  CyberCitizen  
Go to last post Go to first unread
Last post: 2/19/2020 12:16:12 AM(UTC)
Action Email user
by  morpios   Go to last post Go to first unread
Last post: 1/26/2020 10:55:44 AM(UTC)
Action Psexec service delete
by  steveb  
Go to last post Go to first unread
Last post: 1/25/2020 12:15:01 AM(UTC)
Lansweeper Uninstall Software - Mozilla Firefox
by  Carl_Allen   Go to last post Go to first unread
Last post: 1/22/2020 10:44:36 AM(UTC)
Lansweeper Installation Parameters
by  PeterG  
Go to last post Go to first unread
Last post: 1/8/2020 10:11:51 PM(UTC)
Lansweeper embedded questions
by  mkergan   Go to last post Go to first unread
Last post: 12/20/2019 5:19:46 PM(UTC)
Lansweeper Result: Deployment ended: The environment is incorrect.
by  mkergan  
Go to last post Go to first unread
Last post: 12/19/2019 6:31:44 PM(UTC)