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: 441  
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 Only 1 Basic Action not working?
by  DotWAD   Go to last post Go to first unread
Last post: Yesterday at 6:17:05 PM(UTC)
Lansweeper Mapped Drives Incorrect
by  cycleheat  
Go to last post Go to first unread
Last post: Yesterday at 5:21:32 PM(UTC)
Lansweeper Help on creating report list from security groups
by  sc00bs   Go to last post Go to first unread
Last post: Yesterday at 4:52:39 PM(UTC)
Lansweeper Will someone at Lansweeper please take my money?
by  sbAYVdQu  
Go to last post Go to first unread
Last post: Yesterday at 3:31:33 PM(UTC)
Lansweeper Monitor open process
by  Renato   Go to last post Go to first unread
Last post: Yesterday at 3:10:48 PM(UTC)
Lansweeper Duplicate assets (Servers)
by  kjstech  
Go to last post Go to first unread
Last post: Yesterday at 2:34:14 PM(UTC)
Lansweeper Office 365 32bit vs 64bit?
by  CyberCitizen   Go to last post Go to first unread
Last post: Yesterday at 7:22:38 AM(UTC)
Lansweeper "add cc user" doesn't show the correct listings
by  JLPingree  
Go to last post Go to first unread
Last post: 7/6/2020 8:12:44 PM(UTC)