I need Help On an SQL Question.

I need Help On an SQL Question.

Post by ar.. » Sat, 14 Sep 1996 04:00:00



 I have a dBase 5.5 database of my music collection. I want to do a
Query on the artist field (character length of 50) When I issue the following
SQL Statement

SELECT ARTIST FROM Music
WHERE ARTIST  =  "Pink Floyd"

It works fine but when I try this:

SELECT ARTIST FROM Music
WHERE ARTIST  LIKE  "Pink"

I get nothing. No error messages and no matching records. I thought this would
return any records with containing the substring "Pink", How can you do this?
by the way I've tried wildcards and padding out the string , Any other
suggestions??

 
 
 

I need Help On an SQL Question.

Post by Bob Tull » Sat, 14 Sep 1996 04:00:00



>> SELECT ARTIST FROM Music
>> WHERE ARTIST  =  "Pink Floyd"

>> It works fine but when I try this:

>> SELECT ARTIST FROM Music
>> WHERE ARTIST  LIKE  "Pink"

>> I get nothing. No error messages and no matching records. I thought this would

use the % as a wildcard character for LIKE comparisons:

 select artist from music
 where upper(ARTIST) like upper('Pink%');

...Bob


NYC

 
 
 

I need Help On an SQL Question.

Post by Nick Spurrie » Mon, 16 Sep 1996 04:00:00


Where artist like "Pink%" will do the trick.The % is a multiple-wildcard
like * in DOS.

Nick Spurrier (MoDESoft, UK)

 
 
 

1. Need help w/Sql ADO and VB question

Hi,
I have some code (shown below), which opens a stored procedure. One of the
fields returned in the recordset is a bit value. In Sql the bit is stored
(obviously) as a 1 or a 0. When I get the recordset back and look at it in
VB I get a 0 or a -1. This is making me crazy. Is there a way to force it to
return 1 or 0 without having to manually do the conversion after I get the
recordset back? I want the values exactly as they were in sql.
Thanks  ... Ed

    dim oCmd as new ADODB.Command
    dim rs as new ADODB.RecordSet

    oCmd.ActiveConnection = g_sConnectString & db
    oCmd.CommandText = "qrySomeDataWithABitField"
    oCmd.CommandType = adCmdStoredProc
    rs.CursorLocation = adUseClient
    rs.Open oCmd, , adOpenForwardOnly, adLockReadOnly

' at this point, if I look at rs("myBitField") it'll have a 0 or -1 instead
of 0 or 1. How to fix this in the call?

2. ado vb update problem

3. Simple SQL question, need help.

4. FileMaker Pro (svr) 3.03

5. sql question - need help on julian date conversion

6. Sybase Vs SQL Server

7. SQL 7 Stored procedure question Help needed

8. Validation in stored procedure

9. Need SQL Server Guru Help! [BCP Question]

10. Help needed with SQL question

11. SQL question, need help

12. Need help with SQL (Prof question)

13. NEED SQL HELP PLEASE, SELECT DISTINCT QUESTION