Re: How to use the MID function using the Query Builder in VB.NET
- From: "Peter Proost" <pproost@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 25 Apr 2005 15:50:30 +0200
If the records always will contain one letter at the beginning you can use
this query (tested on sql server 2000):
select max(cast(substring(YourField,2,len(YourField)-1) as integer))
FROM YourTable
hth Peter
"Eduardo78" <Eduardo78@xxxxxxxxxxxxxxxxxxxxxxxxx> schreef in bericht
news:3714E252-E722-4AAE-83CD-DE6B42D644D4@xxxxxxxxxxxxxxxx
> Ok, I have a Field that has a combination of letter C and a Number that
> increments by one.
>
> example:
> C1
> C2
> C3
> C4
> C5
> C6
> C7
> C9
> C9
> C10
> C11 ...
>
> I would like to find the Maximun number using the query builder. I tried
> using the Substring function but it didnt work, I also tried the LEFT and
> RIGHT functions but didnt work for me.
>
> I tried using the MID function but it gave an error saying 'MID' is not a
> recognized function name.
>
>
> Please I just would like to find any way to get the highest numer after
the
> letter.
>
> Example: if I have C1 thru C34 I wold like the query to give me 34 as the
> result.
>
> Thanks for any suggestions.
.
- Follow-Ups:
- References:
- How to use the MID function using the Query Builder in VB.NET
- From: Eduardo78
- How to use the MID function using the Query Builder in VB.NET
- Prev by Date: Re: How to use the MID function using the Query Builder in VB.NET
- Next by Date: Asynchronous call or ThreadPool
- Previous by thread: Re: How to use the MID function using the Query Builder in VB.NET
- Next by thread: Re: How to use the MID function using the Query Builder in VB.NET
- Index(es):
Relevant Pages
|