Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL to get the alphabetical next
Message
 
 
À
31/03/2003 09:50:46
Km Kwun
Eastop Consultants Limited
Nt, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00771820
Message ID:
00771999
Vues:
30
Try
SET @LastFirst = @LastName + @FirstName   -- from the previous record.
SELECT TOP 1 *
FROM yourTable
WHERE LastName >= @lastName
 AND FirstName >= @firstName
 AND LastName + FirstName > @LastFirst 
 ORDER BY lastname, firstname
-- or
SELECT TOP 1 *
FROM yourTable
WHERE LastName >= @lastName
 AND FirstName >= @firstName
 AND custID <> @custID
 ORDER BY lastname, firstname
>Dear Michael,
>
>Thank you for your response. However I am afraid the command may not be able to return the correct record since the following customer will not satisfy the WHERE condition of the SQL even if it is actually the alphabetical next.
>CustID=73, LastName='Barret', FirstName='Amy'
>
>KM
>
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform