CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 SQL Like Statement Help

Print topic Send  topic

Author Message
BC
Posted: 05/30/2002, 10:57 AM

Hey All,

I have a quick one. I am trying to display a list of values from records based on a LIKE statement that looks for a Session value called UserEmail. Here is what I have tried thus far without success.


sEMAIL = " (CC_Email LIKE '%(" & ToSQL(Session("UserEmail"), "Text")" & "%')"
sSQL = "ServiceName from PPD_All_Services"
sSQL = sSQL & " where " & sEMAIL
openrs rs, sSQL
EmailLKUP= GetValue(rs, "ServiceName")

I expect when you all see this you will know what I have goofed on, but I have stared at it for 2 hours with out a clue. I think the big problem is pulling the email address into the query.

Thanks for the help.
Ken Hardwick
Posted: 05/30/2002, 12:52 PM

sEMAIL = " (CC_Email LIKE '%(" & ToSQL(Session("UserEmail"), "Text")" & "%')"

The "toSQL" function is also adding '' around the session value..ie...
so ends up something like...'%'????'%'
Also...I see no select statement...
so change to...


sEMAIL = " (CC_Email LIKE '%(" & Session("UserEmail") & "%')"
sSQL = "Select ServiceName from PPD_All_Services"
sSQL = sSQL & " where " & sEMAIL
openrs rs, sSQL
EmailLKUP= GetValue(rs, "ServiceName")



   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.