Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 2nd, 2007, 07:06 AM
Registered User
 
Join Date: Feb 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default instead of substring what should we use in MSACCES

hi,
  userdetails table:

uid username
---- --------
us101 miruthu
us102 raj

select top 1 substring(uid,3,5) from userdetails order by uid desc

if i have query like this
i got o/p
102

it is not working in msaccess.what should i use for it while am using msaccess instead of sqlserver.i want to split us and 101.what should i do.if anyone knows please reply as soon as possible



 
Old February 9th, 2007, 12:13 PM
Authorized User
 
Join Date: Oct 2005
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can use the MID function in MS Access, which is the same as the SUBSTRING in SQL Server:

SELECT TOP 1 MID(UID, 3, 5) FROM UserDetails ORDER BY UID DESC


SQL Server Helper
How well do you know SQL? Find out with the free test assessment from SQL Server Helper!!!
http://www.sql-server-helper.com/free-test/default.aspx

Got a SQL Server Question? Ask us here: http://www.sql-server-helper.com/forums/default.asp





Similar Threads
Thread Thread Starter Forum Replies Last Post
substring in c# sudhirbharti C# 1 February 21st, 2008 01:29 PM
Substring-before with Regex bonekrusher XSLT 6 November 27th, 2007 01:16 PM
substring-before() function. lafilip XSLT 1 July 11th, 2007 05:33 PM
Substring-after collation bonekrusher XSLT 2 May 11th, 2007 09:31 AM
SubString prasanta2expert Access VBA 1 November 17th, 2006 10:04 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.