Print Page | Close Window

Need help with this sql statement

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=23076
Printed Date: 07 April 2026 at 8:12pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Need help with this sql statement
Posted By: kpdillon
Subject: Need help with this sql statement
Date Posted: 09 April 2007 at 3:48am
I'm trying to write a sql statement where it checks to see if both the subject and date match the subject and date variables respectively... I think I have the syntax correct but not the logic... Can someone tell me what I am doing wrong?
 
strSQL = "SELECT " & strDbTable & "Topic.Subject, " & strDbTable & "Topic.Event_date, " & strDbTable & "Topic.Forum_ID FROM " & strDbTable & "Topic "

strSQL = strSQL & "WHERE ((" & strDbTable & "Topic.Forum_ID = " & intForumID & " OR " & strDbTable & "Topic.Forum_ID = " & intForumIDMovedToNB & ") AND (" & strDbTable & "Topic.Subject LIKE '" & strSubjectNB & "%' AND "& strDbTable & "Topic.Event_date LIKE '" & strDate & "%')); "




Replies:
Posted By: kpdillon
Date Posted: 09 April 2007 at 3:29pm
Just to clarify, the issue I am having is that it is ignoring the Event_date check... In other words, I don't want the post to update unless the subject and date both match...  What seems to be happening is that if the subject matches it won't update regardless if the date is different.


Posted By: kpdillon
Date Posted: 09 April 2007 at 4:45pm

Sorry, last post - I promise.  :-)  I basically want to make sure a very specific record does not exist (both the subject and date) not just the subject... Does this SQL statement accomplish that?  It doesn't seem to from what I am seeing..




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net