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: 429  
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 SQL Triggers
by  Kyle Zimmerman   Go to last post Go to first unread
Last post: 3/28/2020 9:43:26 PM(UTC)
Lansweeper Access LS Knowledge base from outside network
by  Hagobian  
Go to last post Go to first unread
Last post: 3/28/2020 12:46:44 AM(UTC)
Lansweeper Wake on Lan wol.exe issue
by  Socal_s197   Go to last post Go to first unread
Last post: 3/27/2020 10:05:42 PM(UTC)
Lansweeper Scanning Queue locked
by  KevinA-REJIS  
Go to last post Go to first unread
Last post: 3/27/2020 8:48:45 PM(UTC)
Lansweeper Asset Radar requirements
by  bbeavis   Go to last post Go to first unread
Last post: 3/27/2020 6:58:20 PM(UTC)
Lansweeper LSAgent Cloud Relay error
by  nlertn  
Go to last post Go to first unread
Last post: 3/27/2020 6:35:55 PM(UTC)
Lansweeper Scanning IP Range Subnet
by  WeatherDave   Go to last post Go to first unread
Last post: 3/27/2020 5:39:17 PM(UTC)