Results 1 to 3 of 3

Thread: Incorrect syntax near '*'.: SELECT TOP 6 * FROM

  1. #1
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Incorrect syntax near '*'.: SELECT TOP 6 * FROM

    Incorrect syntax near '*'.: SELECT TOP 6 * FROM
    (
    SELECT ROW_NUMBER() OVER (ORDER BY calls.id) AS row_number, count(*) counter, calls.id , calls_cstm.*, calls.status , calls.name , calls.duration_hours , calls.duration_minutes , calls.date_start , calls.assigned_user_id
    from calls left join calls_cstm on calls.id = calls_cstm.id_c inner join calls_users on calls.id = calls_users.call_id where (((calls.status in ('planned')
    ))) and calls.deleted=0 and calls_users.deleted = 0 and (calls.assigned_user_id = '1' or calls_users.user_id = '1')
    group by calls.id, calls_cstm.*, calls.status, calls.name, calls.duration_hours, calls.duration_minutes, calls.date_start, calls.assigned_user_id
    ) AS a
    WHERE row_number > 5


    calls_cstm.* is in the group by clause instead of each custom field that is referenced. We get this if on the Calls dashlet and we hit next for the next set of results.
    Last edited by eggsurplus; 2008-07-11 at 07:48 PM.

  2. #2
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: Incorrect syntax near '*'.: SELECT TOP 6 * FROM

    This only happens when you have "My Calls" checked. So it must be something with:
    PHP Code:
                $lvsParams = array(
                               
    'custom_from' => ' INNER JOIN calls_users ON calls.id = calls_users.call_id ',
                               
    'custom_where' => ' AND calls_users.deleted = 0 AND (calls.assigned_user_id = \'' $current_user->id '\' OR calls_users.user_id = \'' $current_user->id '\') ',
                               
    'distinct' => true
                               
    ); 
    in MyCallsDashlet.php. Having these params set must cause it to create a different list query. Will have more info later along with a resolution.

  3. #3
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: Incorrect syntax near '*'.: SELECT TOP 6 * FROM

    Setting distinct to false in the code snippet above solved the issue.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Dangers with Multiple Select Fields Part 1 - Editing
    By neilt in forum Feature Requests
    Replies: 1
    Last Post: 2011-09-27, 09:58 PM
  2. Replies: 0
    Last Post: 2007-12-27, 12:40 PM
  3. Replies: 5
    Last Post: 2007-11-13, 02:51 PM
  4. Replies: 3
    Last Post: 2007-06-18, 10:06 PM
  5. Serious issue with sugarcrm 3.5.1.c
    By wp.rauchholz in forum Help
    Replies: 17
    Last Post: 2005-12-01, 07:22 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •