|
-
Jun 3rd, 2003, 07:38 AM
#1
Thread Starter
KING BODWAD XXI
-
Jun 3rd, 2003, 07:43 AM
#2
Addicted Member
("SELECT * FROM Customers WHERE [Site Name] LIKE 'A%'")
Should do it
Simon
-
Jun 3rd, 2003, 07:45 AM
#3
try putting the wildcard in the single ticks
-
Jun 3rd, 2003, 07:45 AM
#4
Originally posted by Simon_R
("SELECT * FROM Customers WHERE [Site Name] LIKE 'A%'")
Should do it
Simon
beat me to it
-
Jun 3rd, 2003, 07:55 AM
#5
Thread Starter
KING BODWAD XXI
-
Jun 3rd, 2003, 08:10 AM
#6
Fanatic Member
No, they're correct and YOU'RE wrong. Your SQL statement should look like this when it's finished:
SELECT * FROM Customers WHERE [Site Name] LIKE 'A%'
That will return all records that have entries in the Site Name column that start with the capital letter A.
You may want to check if the column should be called:
Site_Name 'may need to avoid space in column name
Do canibals not eat clowns because they taste funny? 
-
Jun 3rd, 2003, 08:23 AM
#7
Originally posted by doofusboy
No, they're correct and YOU'RE wrong. Your SQL statement should look like this when it's finished:
SELECT * FROM Customers WHERE [Site Name] LIKE 'A%'
That will return all records that have entries in the Site Name column that start with the capital letter A.
You may want to check if the column should be called:
Site_Name 'may need to avoid space in column name
WOW! Talk about the kettle calling the pot black.... Doofus... before you start sligning it around like that, you may want to look up your info first. So far I have not yet seen the right answer.... Bodw is right, putting the % WILL CAUSE A SYNTAX ERROR. That's because he's using an ACCESS DATABASE.... Remember the open database command at the top of his code? He's opening an MDB file, Access. In Access, for what ever reason, MS decided that the wildcard should be a "*", not "%". So, the truly correct answer is:
1) Change the % to a *
2) Move the * to inside the tick marks
That should do it for you.
-
Jun 3rd, 2003, 08:28 AM
#8
Originally posted by techgnome
WOW! Talk about the kettle calling the pot black.... Doofus... before you start sligning it around like that, you may want to look up your info first. So far I have not yet seen the right answer.... Bodw is right, putting the % WILL CAUSE A SYNTAX ERROR. That's because he's using an ACCESS DATABASE.... Remember the open database command at the top of his code? He's opening an MDB file, Access. In Access, for what ever reason, MS decided that the wildcard should be a "*", not "%". So, the truly correct answer is:
1) Change the % to a *
2) Move the * to inside the tick marks
That should do it for you.
actually the % wont cause an error.. it will just return an empty recordset.. the error was due to the tick mark placement
-
Jun 3rd, 2003, 08:42 AM
#9
Thread Starter
KING BODWAD XXI
-
Jun 3rd, 2003, 09:01 AM
#10
Fanatic Member
By the way, the word is spelled "s l i n g i n g".
When use SQL within Access wildcard character is *.
When using SQL from VB to query an Access database, using wildcard character % is perfectly acceptable. I use it all the time Mr. Smart (__*__).
Do canibals not eat clowns because they taste funny? 
-
Jun 3rd, 2003, 09:17 AM
#11
Thread Starter
KING BODWAD XXI
-
Jun 3rd, 2003, 09:35 AM
#12
no he is right... i use % in some SQL statements via ADO that query an access database... and low and behold they always did and still work
-
Jun 3rd, 2003, 10:14 AM
#13
Thread Starter
KING BODWAD XXI
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|