#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    1
    Rep Power
    0

    New to SQL. Please help


    I am receiving an error from my FROM statement and was hoping I could be pointed in the right direction.

    Thanks!

    SELECT [Deal ID],
    [Account Number],
    [Teller],
    [Agent],
    [Supervisor],
    [Manager],
    [Area],
    [Date Taken],
    [Month Taken],
    [Target Date],
    [Target Month],
    [Date Kept],
    [Month Kept],
    [Promise Status],
    DEALS_MASTER_TABLE.DEAL_ID AS [Deal ID],
    DEALS_MASTER_TABLE.ACCOUNT_NUMBER AS [Account Number],
    DEALS_MASTER_TABLE.TELLER AS [Teller],
    MS_USERS.USER_NAME AS [Agent],
    DEALS_MASTER_TABLE.SUPERVISOR AS [Supervisor],
    DEALS_MASTER_TABLE.MANAGER AS [Manager],
    MS_USERS.AREA_ID_ASSIGN AS [Area],
    DEALS_MASTER_TABLE.ENTER_START_DATE AS [Date Taken],
    DATEADD(D,-DAY(DEALS_MASTER_TABLE.ENTER_START_DATE)+1, DEALS_MASTER_TABLE.ENTER_START_DATE) AS [Month Taken],
    DEALS_MASTER_TABLE.TARGET_DATE AS [Target Date],
    DATEADD(D,-DAY(DEALS_MASTER_TABLE.TARGET_DATE)+1, DEALS_MASTER_TABLE.TARGET_DATE) AS [Target Month],
    DEALS_MASTER_TABLE.KEPT_END_DATE AS [Date Kept],
    DATEADD(D,-DAY(DEALS_MASTER_TABLE.KEPT_END_DATE)+1, DEALS_MASTER_TABLE. KEPT_END_DATE) AS [Month Kept],
    DEALS_MASTER_TABLE.STATUS_GROUP AS [Promise Status],
    FROM DEALS_MASTER_TABLE
    INNER JOIN MS_USERS ON DEALS_MASTER_TABLE.TELLER = MS_USERS.USER_ID
    WHERE DEALS_MASTER_TABLE.TYPE = 'PROMISE'
    AND DEALS_MASTER_TABLE.ENTER_START_DATE >= '2012-10-01'
    AND STATUS_GROUP <> 'PENDING_PROMISE'
    AND LEFT(MS_USERS.AREA_ID_ASSIGN,3) = 'COL'
    OR MS_USERS.AREA_ID_ASSIGN IN('INQ75','INQ85','INQ95','INQ90')
    AND DEALS_MASTER_TABLE.ENTER_START_DATE < DATEADD(M,1, DEALS_MASTER_TABLE.ENTER_START_NEXT_DUE)
    AND DEALS_MASTER_TABLE.ENTER_START_DATE > DEALS_MASTER_TABLE.ENTER_START_NEXT_DUE
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2003
    Location
    Paris Uppland
    Posts
    2,377
    Rep Power
    391
    Remove the comma at the end of the line that preceeds the from clause.

IMN logo majestic logo threadwatch logo seochat tools logo