Reply
MySQL, SQL IFNULL
Old 08-31-2004, 04:50 PM MySQL, SQL IFNULL
wbmstr2good's Avatar
Average Talker

Posts: 22
How do I properly use this function in an SQL query. This is how I'm doing it:

SELECT EVENTID, USERNAME, IFNULL(COMMENTS, "") FROM EVENTS;

What am I doing wrong?
wbmstr2good is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 08-31-2004, 05:16 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Seems correct to me, are you getting any errors? What version of mySql are you running?
Anacrusis is offline
Reply With Quote
View Public Profile Visit Anacrusis's homepage!
 
Old 08-31-2004, 05:26 PM
wbmstr2good's Avatar
Average Talker

Posts: 22
I'm running the ODBC connector 3.51 and the error I'm getting is as follows:

ADODB.Recordset error '800a0cc1'

Item cannot be found in the collection corresponding to the requested name or ordinal.

/manageevents.asp, line 35

And here is Line 35:

strComments = adoRS("COMMENTS")
wbmstr2good is offline
Reply With Quote
View Public Profile
 
Old 08-31-2004, 05:29 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Try this:

SELECT EVENTID, USERNAME, IFNULL(COMMENTS, "") as COMMENTS
Anacrusis is offline
Reply With Quote
View Public Profile Visit Anacrusis's homepage!
 
Old 09-01-2004, 12:34 PM
wbmstr2good's Avatar
Average Talker

Posts: 22
got it, I was using double quotes instead of single, and no AS columnname
wbmstr2good is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to MySQL, SQL IFNULL
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.14406 seconds with 12 queries