473,598 Members | 3,409 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Like and Access

Hello,

I have a postal code field, when I run the query to ask the user which
postal code want to view.

I need to use like now, so if If the user wants all the postal codes
which begins in 17, Selec * from PostalCodes where "[PostalCode]*"
doesn´t work, what is the way to do it in access.

Thanks for your replies.
Jul 31 '06 #1
2 1764

Arturo Guzman wrote:
Hello,

I have a postal code field, when I run the query to ask the user which
postal code want to view.

I need to use like now, so if If the user wants all the postal codes
which begins in 17, Selec * from PostalCodes where "[PostalCode]*"
doesn´t work, what is the way to do it in access.

Thanks for your replies.
Hi Arturo

This is the correct way of writing the like with a wildcard:

SELECT PostCode
FROM tblPostCode
WHERE ((PostCode) Like "17*")

Good luck

Nick

Jul 31 '06 #2
On Mon, 31 Jul 2006 20:36:57 +0200, Arturo Guzman wrote:
Hello,

I have a postal code field, when I run the query to ask the user which
postal code want to view.

I need to use like now, so if If the user wants all the postal codes
which begins in 17, Selec * from PostalCodes where "[PostalCode]*"
doesn´t work, what is the way to do it in access.

Thanks for your replies.
I'm sure you wish the user to be able to change the postal code
whenever he wants without modifying the query.

Select YourTable.* from YourTable where [PostalCodeField] Like [Enter
Start of code] & "*"

The user will be prompted of for the beginning of the code.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Jul 31 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
15584
by: SkunkDave | last post by:
Having this description column in a table "Cookies, peanut butter sandwich, regular" When using this WHERE clause: WHERE (((Food_Data.Description) Like "*Butter*" & "*Peanut*")); I dont get any results, however when using it this way round
2
1401
by: Rigid Kitten | last post by:
I cannot figure out how to: 1. call an Access query from C# and consume the recordset, where the query uses a user defined function. for example select rowid, GetBreedOfCat() from tblCats; 2. call an Access function from C# and consume the returned value. For
0
1590
by: Jason Heyes | last post by:
I wrote a previous post that asked whether there was a reference-counted implementation of std::vector. Apparantly there wasn't. So my next question is, is it possible to write your own shared container that behaves like std::vector? Here is me trying to answer that question: class FooReference;
2
3143
by: bissatch | last post by:
I am trying to compare two variable but using regular expression: $access = "glasgow" $areaid = "glasgow-westend-byers_rd" using the two variables, I would like the areaid variable to be compared with the access variable. the regular expression function will return true if $access matches the start of $areaid. So the two above would return true
3
12943
by: Joerg Glissmann | last post by:
Hi there, is there a way to link an Access XP database to a query in a different database (Access XP as well) like you can do with tables? My front ends need to operate on different data segments on one database and I would like to get around modifying them.. Any help would be greatly appreciated.
3
2547
by: Pete | last post by:
Is there any possiblity of writing an Access or Visual Basic application that provides a method of sharing the window focus between Access and the Shell application? i.e. Shell("c:\windows\calculator.exe", vbNormalNoFocus) In other words are there Win2000/XP api's that would allow you to control the functionality of the calculator. I'm just using the calculator application as an example I am actually trying to control a main frame app...
2
5561
by: Michael C | last post by:
Hi all. When I run the following query against my Access database - from within Access - it returns the correct results (5 records in this instance): SELECT * FROM WHERE = "Clothes" AND LIKE "*brown*" However, when I run it from my ASP.NET page via an OleDBCommand, it returns 0 records every time. Now for the kicker: When I drop the LIKE clause, the query returns the correct results (10 records in this instance) from within...
5
4915
by: Takeadoe | last post by:
Gang - I'm generating date and time variables from scanned forms. Currently, the date and time values are as follows: 06/26/2006 and 11:30 AM. I've written VBA code to combine them into a single string. The resulting variable - datetime - is exported automatically to Access. When it get's there it looks like "06/26/2006 11:30 AM". Problem is, it is a string. If I set up the database before it is populated with records and set the...
8
8039
by: Roland Hall | last post by:
In Access you use "*" + + "*", + can be replaced with & Calling a parameterized query in Access requires % be used in place of *, however, all that I have read show dynamic SQL passed to Access: WHERE LIKE '" & ASPvar & "' % ORDER BY ... However, my call is similar to: conn.qMyLookup strVar, rs
30
1950
by: Adam Baker | last post by:
Hello, I'm writing a site where a handful of people will be able to edit the content using PHP scripts (FCKeditor). The content is stored as individual files in a directory. I'd like to validate the "editors" using PHP, cookies, etc. The question is what file permissions I need to allow for the content to be writable by my PHP script. Do I really need to give write permissions to the "other" group. Are all wikis really that vulnerable?...
0
8395
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8398
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8050
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5438
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3898
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3939
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2412
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1504
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1250
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.