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

Lansweeper Report on clients with no LSAgent
by  RobertB   Go to last post Go to first unread
Last post: Yesterday at 6:55:32 PM(UTC)
Lansweeper Lansweeper report to match computer name
by  RC62N   Go to last post Go to first unread
Last post: 2/19/2020 5:02:27 PM(UTC)
Lansweeper Distinct user logins per PC
by  Bruce Garoutte   Go to last post Go to first unread
Last post: 2/17/2020 6:36:29 PM(UTC)
Lansweeper Software version report issue
by  RC62N  
Go to last post Go to first unread
Last post: 2/17/2020 4:07:20 PM(UTC)
Lansweeper Patch Tuesday - Exclude Win 2008 & Win7
by  doone128   Go to last post Go to first unread
Last post: 2/17/2020 1:34:36 PM(UTC)
Lansweeper Performance statistics combined into one report
by  djs1789  
Go to last post Go to first unread
Last post: 2/15/2020 1:50:32 AM(UTC)