No announcement yet.

SQL script?

  • Filter
  • Time
  • Show
Clear All
new posts

  • [Forum] SQL script?

    Don't have a master in SQL programming and might need some help....

    Here is the scenario:
    To keep FULL membership in our club you need to attend at least one meeting a year. To keep VOTING rights you need to attend at two meetings a year.
    To keep track of all this I created 2 custom fields where we can enter the dates a member attended a meeting.
    Then I created a sql query script to pull a list from those members who are currently members but if they didn't attended meetings within a timeframe they should show up in this list and we can change their user group accordingly

    I think I am somewhat on the right track with my script but it has bugs.
    Field 8 and 9 are the fields I created for the dates
    Reason I included user group and member group "12": Those are lifetime members and don't need to attend meetings. Those shouldn't show up in the list.
    Issues I have:
    For some reason when I run the script it actually shows those users who attended instead of those who didn't attended.
    Question also: This user fields are dates. Do I have to convert them to date fields to get the script working properly?

    I know it sounds complicated but I still hope somebody can help me out here.
    Thanks so much

    PHP Code:
    SELECT userfield.field8userfield.field9user.useriduser.usernameuser.membergroupidsuser.usergroupid
    FROM userfield
    WHERE userfield
    .userid user.userid
    AND ((userfield.field8 NOT 
    AND '2010-06-10'
    OR userfield.field9 NOT 
    AND '2010-06-10')
    AND (
    user.usergroupid <> '12'
    AND user.membergroupids NOT LIKE '12'))
    AND (
    userfield.field8 <> ' '
    OR userfield.field9 <> ' ')
    ORDER BY `user`.`usernameASC 

  • #2
    You should ask this at, our modification site.


    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.