Run this in ISQL (Query Analyzer):
declare @dt varchar(10)
select @dt = '4/12/00'
select Original = @dt,
       Converted = substring(@dt, charindex('/', @dt) + 1, charindex('/', @dt, charindex('/', @dt) + 1) - charindex('/', @dt) - 1)
                   + '/' +
                   substring(@dt, 1, charindex('/', @dt) - 1)
                   + '/' +
                   reverse(substring(reverse(@dt), 1, charindex('/', reverse(@dt)) - 1))
Is this the foundation for what you're looking for?
I adapted code that I found to convert an IP address (string)
into 4 integer octets:
  http://www.ntfaq.com/ntfaq/sql332.html#sql332
Josh
> > From: <marcus@redcentre.com>
> > > Josh,
> > > thanks - this is very helpful.  The other part of the problem is if
> > > a date is entered into the web page as dd/mm/yy - how would I
> > > convert the it to a mm/dd/yy string.  This needs to be done prior to
> > > passing the the SQL queries.
> > 
> > This is going to be tricky.  It can be done to some degree using lots
> > of trickery (because "03/12/00" is not necessarily March 12, 2000 --
> > it could be December 3, 2000.  Before getting into this, what is this
> > field for?  Is it something a customer would enter in or your internal
> > people?  It'd be easier to just put on the page, "Month/Day/Year".  It
> > doesn't matter whether or not the Month and/or day are 2 characters or
> > 1, nor does it matter (for several years before/after the current)
> > with the year being 4 digits vs. 2.
> > 
> > Josh
> > 
> > > > From: <marcus@redcentre.com>
> > > > > We have been using the Tim_on IDC scripts (downloaded from the
> > > > > Emerald ftp site).  One of the problems with these scripts is
> > > > > that the date format (as entered on the Web page) is mm/dd/yy. 
> > > > > We require dd/mm/yy.  Would somebody be able to explain how we
> > > > > change the date format over?
> > > >
> > > > CompleteDate = convert(char(8), getdate(), 3) +' '+
> > > >                convert(char(8), getdate(), 8)
> > > > or
> > > > CompleteDate = convert(char(8), getdate(), 3) +' '+
> > > >                convert(char(12), getdate(), 14)
> > > >
> > > >
> > > > The first line shows the date.  The second line shows the time. If
> > > > you're pulling a specific date field instead of the current
> > > > date/time, replace "getdate()" with "CallDate" or whatever the
> > > > field is named.
> > > >
> > >
> > >
> > > For more information about this list (including removal) go to:
> > > http://www.iea-software.com/support/maillists/liststart
> > >
> > 
> > 
> > For more information about this list (including removal) go to:
> > http://www.iea-software.com/support/maillists/liststart
> > 
> 
> 
> 
> For more information about this list (including removal) go to:
> http://www.iea-software.com/support/maillists/liststart
For more information about this list (including removal) go to:
http://www.iea-software.com/support/maillists/liststart