Darren DICK
darrend at nimble.com.au
Tue Feb 28 16:23:00 CST 2006
Howdy <Hangs head in embarrassed shame> Sigh - Yes I realised about 1 am this am The code was doing exactly what it was designed to do - return a path - not a file name Many thanks Stuart I copy and pasted your mod and it works brilliantly And yes - I now have 2 functions 1 returning the path the other returning the FileName Many many thanks....again How'd the conference go?? Darren ------------------------------ T: 0424 696 433 -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Wednesday, 1 March 2006 8:20 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Wend Statement Not Allowed On 1 Mar 2006 at 0:22, Darren HALL wrote: > The desired result is > From..... .C:\Program Files\Some Folder\some cool file.dll I > want.....some cool file.dll But I am getting.....C:\Program Files\Some > Folder That's what I would expect from a function named "GetPath" <g> ..... >GetPath = Left$(aPath, aSlash) Left$ is returning everything in aPath *up to* the last "\". If you want everything *after* this, change this line to read : = Right$(aPath,Len(aPath) - aSlash) I would also change the name of the function to GetFilename() or something similar. -- Stuart _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com