sql problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using this query to find the totals for all children where child_ID is equal to the sesison variable.
there is nothing wrong with the session variable b/c other stuff that depends on it works fine.
Is there anything wrong with this query?
thanks!
SELECT Sum(tuition) FROM child WHERE child_ID = '" + Replace(total_due__MMColParam, "'", "''") + "'"
 
If a value of Replace function is NULL your entire select statement becomes
NULL.
Try to substitute pluses (+) with ampersands (&) this should take care of
NULLs.
Do you really need that Replace in the query? I don't see any reason for
total_due having apostrophee in it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top