Expression >
Forums - Accueil
>
Expression Web and SuperPreview
>
Structure a 'Where' Statement in Gridview
Structure a 'Where' Statement in Gridview
- How do I structure the 'Where' statement so that the results will return the records where the first letter of the column field begins with a letter entered in the search box by the user?
I'm able to to use the 'like' option where the results return all records containing the entered letter, but I need only the first letter.
Also, is there a default option like a (%) which when entered in the search box will return all records?
Réponses
- ClarkNK,
Worked like a charm. Thank you very much.
btw, your tutorials have been a great help to me as I transition from FP to EW.
Thanks again.- Marqué comme réponsejaymike vendredi 6 novembre 2009 20:59
Toutes les réponses
- What is the database? In MySQL you would use the LEFT string function .
--
Chris Hanscom - Microsoft MVP
On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help
Get a Complete Website Analysis by Veign - It's a MS Access database
- This states:
http://www.databasedev.co.uk/access-sql-string-functions.html
That Access supports the LEFT function.
So try (air-code) something like to return records where myfield starts with A:
SELECT myfield FROM mytable WHERE LEFT(myfield, 1) = 'A'
--
Chris Hanscom - Microsoft MVP
On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help
Get a Complete Website Analysis by Veign - If your current statement is like this:
WHERE ([field] LIKE '%' + ? + '%')
then change it to like this:
WHERE ([field] LIKE ? + '%')
ClarkNK, A.K.A. HomePage Doctor
HomePageDoctor.com -- Expression Web database tutorials
Ownertrades.com -- Created with FP, Access, Bots and Wizards
MyNumbersTracker.com -- Created with Expression, VWDExress, SQL Express, and ASP.NET.- Proposé comme réponsepaladyn samedi 7 novembre 2009 02:55
- ClarkNK,
Worked like a charm. Thank you very much.
btw, your tutorials have been a great help to me as I transition from FP to EW.
Thanks again.- Marqué comme réponsejaymike vendredi 6 novembre 2009 20:59
ClarkNK,
Jaymike, just so you know, it is appropriate to Mark As Answer the post that actually answered your question, not your own reply. In this case, that would be Clark's post, above.
Worked like a charm. Thank you very much.
btw, your tutorials have been a great help to me as I transition from FP to EW.
Thanks again.
The reason is that not only is it polite to recognize the contribution of whomever solved your problem, but it also helps others to find the answer when searching the forum. You will note that the post marked as answer is highlighted in green and copied to the top of the thread. This makes it easy for others to find the post which provided the actual answer. As you can probably see, your reply doesn't do much to answer the topic question. ;-)
You're new to the forum, so this probably hasn't been pointed out to you before. Just thought you'd like to know...
cheers,
scott
Plural's don't have apostrophe's. It seem's sometime's that any word's ending in "s" get a gratuitous apostrophe. Apostrophe's are used to indicate possessive's and elision's (contraction's or abbreviation's).- Thanks for the advice. Pls excuse my ignorance.

