Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Strip First 5 Characters from Query Result

Status
Not open for further replies.

johnfrani

Technical User
Oct 2, 2002
33
US
I am using MS Access 2000.

When I finish a personnel report and want it to appear in the personnel report's list box, I preface the report name with (rpt).

The query below selects reports that begin with (rpt) and populates the personnel report list box successfully.


SELECT [MsysObjects].[Name], [MsysObjects].[Name] FROM MsysObjects WHERE ((([MsysObjects].[Name]) Not Like "~*" And ([MsysObjects].[Name]) Not Like "MSys*") And (([MsysObjects].[Name]) Like "(rpt) *") And (([MsysObjects].[Type])=-32764)) ORDER BY [MsysObjects].[Name];


The user can click on the displayed report to run it.

My Problem is that I don't want the (rpt) to display as part of the report name in the list box.

How can I modify the above query so it continues to select the (rpt) reports but does not display the (rpt) in the list box?

Or, is there a better way to accomplish this task?

Thanks
John
 
SELECT Mid([Name],7), [Name] FROM MsysObjects WHERE [Name] Like "(rpt) *") AND Type=-32764 ORDER BY 1;


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top