How to access the value of a field of the current node in Drupal?

SQL in MS Access - count the total number of times each field has a particular value?

  • Hi sorry if the title isn't clear - I'm not sure how to phrase it! I'm using MS Access SQL, and here is the code I would like to run: SELECT TOP 1 Members_Ex_Classes.Class_ID, (SELECT COUNT(["Liked?"]= "Y") FROM Non_Members_Ex_Classes) + (SELECT COUNT(["Liked?"] = "Y") FROM Members_Ex_Classes) AS [Total Number of Likes] FROM Members_Ex_Classes, Non_Members_Ex_Classes WHERE Members_Ex_Classes.["Liked?"] = "Y" or Non_Members_Ex_Classes.["Liked?"] = "Y" GROUP BY Members_Ex_Classes.Class_ID, Non_Members_Ex_Classes.Class_ID ORDER BY COUNT(Members_Ex_Classes.Class_ID) DESC I would like to display the total number of "Likes" the Class_ID with the most likes has from both the members_ex_classes and non_members_ex_classes tables. (The same class_ids are used in both tables) How can I change my code to make it work? Thanks

  • Answer:

    you've got some messy code up here... probably clearer to set up actual subqueries. It would be useful if you post your database somewhere so we can download and test with it But check out the SQL command "HAVING", that might help you out. You have a field name with a question mark in it? first time I've seen that ["Liked?"]

S at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.