Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Need help with this sql statement
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Need help with this sql statement

 Post Reply Post Reply
Author
kpdillon View Drop Down
Groupie
Groupie


Joined: 29 December 2006
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote kpdillon Quote  Post ReplyReply Direct Link To This Post Topic: Need help with this sql statement
    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 & "%')); "

Back to Top
kpdillon View Drop Down
Groupie
Groupie


Joined: 29 December 2006
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote kpdillon Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
kpdillon View Drop Down
Groupie
Groupie


Joined: 29 December 2006
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote kpdillon Quote  Post ReplyReply Direct Link To This Post 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..

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.