Results 1 to 3 of 3

Thread: Help with simple listing query

  1. #1
    sbantz is offline Sugar Community Member
    Join Date
    Sep 2007
    Posts
    52

    Default Help with simple listing query

    SugarCRM 5.0.0b with Zucker reports 1.8

    I am trying to run a simple listing query that shows the date a note was entered, who it was created by, and the name of the note. The problem I am having is that I cannot figure out how to have the query show the username rather than the alphanumeric identifier for the user, like 3b388195-355d-827c-d111-46eee823b0bc

    SELECT notes.date_entered, notes.created_by, notes.name
    FROM notes
    ORDER BY notes.created_by, notes.date_entered;

    I assume I need to have this show user.username but I cannot figure out how to get it to show that correctly.

    Thanks for any pointers.

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Help with simple listing query

    Try this:

    Code:
    SELECT notes.date_entered, concat(users.first_name, ' ', users.last_name), notes.name
    FROM notes
    JOIN users
    ON notes.created_by = users.id
    ORDER BY notes.created_by, notes.date_entered;
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  3. #3
    sbantz is offline Sugar Community Member
    Join Date
    Sep 2007
    Posts
    52

    Default Re: Help with simple listing query

    That's why I like these forums a lot. Thank you very much, Angel. it worked like a charm.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 2007-10-12, 09:56 PM
  2. Upgrade from Open Source to Professional
    By Sohonet in forum General Discussion
    Replies: 1
    Last Post: 2006-06-12, 09:23 PM
  3. SugarCrm 4.0 Patch
    By mgamboa in forum General Discussion
    Replies: 0
    Last Post: 2005-12-21, 04:14 PM

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
  •