MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 12th, 2012, 01:09 PM
bamv4317 bamv4317 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 1 bamv4317 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 38 m 15 sec
Reputation 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

Reply With Quote
  #2  
Old April 12th, 2012, 01:13 PM
swampBoogie swampBoogie is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: Paris Uppland
Posts: 2,351 swampBoogie User rank is Major (30000 - 40000 Reputation Level)swampBoogie User rank is Major (30000 - 40000 Reputation Level)swampBoogie User rank is Major (30000 - 40000 Reputation Level)swampBoogie User rank is Major (30000 - 40000 Reputation Level)swampBoogie User rank is Major (30000 - 40000 Reputation Level)swampBoogie User rank is Major (30000 - 40000 Reputation Level)swampBoogie User rank is Major (30000 - 40000 Reputation Level)swampBoogie User rank is Major (30000 - 40000 Reputation Level)swampBoogie User rank is Major (30000 - 40000 Reputation Level)swampBoogie User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 4 Days 8 h 2 m 6 sec
Reputation Power: 390
Remove the comma at the end of the line that preceeds the from clause.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > New to SQL. Please help

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap