Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 24th, 2003, 12:36 AM
Authorized User
 
Join Date: Jun 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to vickriz
Default SQL statement for query

HOw to make a query that finds in a field in surname which abbriviated only.
sample records:
NAME SNAME
Luieso A
Abelardo Cano
Cherry D
Chayong K
Abdula H
Paul Akir

the result of the query would be:
NAME SNAME
Luieso A
Cherry D
Chayong K
Abdula H
=====================

pls help..


Mabuhay!!!
__________________
Mabuhay!!!
 
Old September 24th, 2003, 05:48 AM
Authorized User
 
Join Date: Jul 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Doing a little testing in Access 2000/Win XP the following SQL works for me.
Code:
SELECT names.Name, names.Surname
FROM [names]
WHERE ((Len([names.Surname])="1"));
 
Old September 24th, 2003, 10:10 PM
Authorized User
 
Join Date: Jun 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to vickriz
Default

Quote:
quote:Originally posted by misterqj
 Doing a little testing in Access 2000/Win XP the following SQL works for me.
Code:
SELECT names.Name, names.Surname
FROM [names]
WHERE ((Len([names.Surname])="1"));
im getting an error when i run this..
SELECT myTable.Surname, myTable.FirstName, myTable.MiddleName
FROM myTable
WHERE ((Len([myTable.MiddleName])="1"));

error encountered:
"Invalid backeting of name '[myTable.Surname]'."

by the way in using access 98 in win2K.

Mabuhay!!!
 
Old September 24th, 2003, 10:12 PM
Authorized User
 
Join Date: Jun 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to vickriz
Default

im getting an error when i run this..
SELECT myTable.LastName, myTable.FirstName, myTable.MiddleName
FROM myTable
WHERE ((Len([myTable.MiddleName])="1"));

error encountered:
"Invalid backeting of name '[myTable.MiddleName]'."

by the way in using access 98 in win2K.

Mabuhay!!!
 
Old September 24th, 2003, 10:16 PM
Authorized User
 
Join Date: Jun 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to vickriz
Default

Quote:
quote:Originally posted by misterqj
 Doing a little testing in Access 2000/Win XP the following SQL works for me.
Code:
SELECT names.Name, names.Surname
FROM [names]
WHERE ((Len([names.Surname])="1"));
Hi again... thanks for help i got it correct now...

just forget to used a close bracket; (Len([myTable].[MiddleName])="1"))

more power misterqj..

Mabuhay!!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
IF statement in SQL Pass Through Query Coby Access VBA 3 February 15th, 2008 09:24 AM
convert a SQL Statement from MS Access to a SQL Corey Access 6 March 28th, 2007 12:33 PM
query statement larry67 Access 1 March 8th, 2007 12:41 PM
If Statement Query rsm42 ASP.NET 1.0 and 1.1 Basics 3 February 18th, 2007 12:04 AM
how to remove the query statement? gilgalbiblewheel Classic ASP Databases 8 September 11th, 2004 11:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.