Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Searching for the last six digits
Message
De
19/04/2013 04:29:31
 
 
À
18/04/2013 20:38:34
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01571435
Message ID:
01571455
Vues:
44
Try any of the following
Select * from mytable where Right ( myfiled,6)=myEnteredvalue
Select * from mytable where Right (Alltrim( myfiled,6)=myEnteredvalue
If myfiled is Numeric , than you need to use STR() also.

Hope That Helps



I need to do a SQL command which will search on a field which has 15 characters but the user will enter the last six digits only. So, basically, the first 9 characters are not entered and I must find the record matching the last six digits. I usually do the opposite with the % character at the end combined with a LIKE. Anyone has an example on this type of search?
Harsh
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform