Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need ODBC Valid SQL syntax
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00563510
Message ID:
00564469
Views:
20
>Also show here your union statement. May be I will have an idea.

You asked for it and here it is. Remember before I was dealing with a concept SQL what follows is the real one that is erroring out.
SELECT ActionItem.ActionKey, ActionItem.ActionDate, ActionItem.ActionNumber,
       ActionItem.ActionAltId, ActionItem.DueDate, ActionItem.RestrictToUser,
       ActionItem.ActionCompleteDate, ActionItem.StatusKey, 
       ActionItem.AssignByUserKey, ActionItem.CategoryKey, 
       ActionAssignTo.ActionAssignToKey, ActionAssignTo.AssignToDueDate, 
       ActionAssignTo.AcceptRejectDelegate, ActionAssignTo.AssignCompleteDate, 
       ActionAssignTo.PriorityKey, ActionAssignTo.StatusKey, 
       ActionAssignTo.AssignToUserKey, ActionStatus.Status AS ActionStatus, 
       ActionCategory.CategoryName, ActionPriority.Priority, 
       AssignStatus.Status AS AssignStatus, 
       ActionUsers.FirstName AS ActionUserFname, 
       ActionUsers.lastName AS ActionUserLname, 
       AssignUsers.FirstName AS AssignUserFname, 
       AssignUsers.lastName AS AssignUserLname 
FROM ActionItem, ActionAssignTo, ActionStatus, ActionCategory, 
     users ActionUsers, ActionPriority, AssignStatus, users AssignUsers 
WHERE ActionItem.ActionKey = ActionAssignTo.ActionKey AND 
      ActionItem.StatusKey = ActionStatus.StatusKey AND 
      ActionItem.CategoryKey = ActionCategory.CategoryKey AND 
      ActionItem.AssignByUserKey = ActionUsers.UserKey AND 
      ActionAssignTo.PriorityKey = ActionPriority.PriorityKey AND 
      ActionAssignTo.StatusKey = AssignStatus.StatusKey AND 
      ActionAssignTo.AssignToUserKey = AssignUsers.UserKey AND 
      ActionItem.AssignByUserKey = 17 
UNION 
SELECT ActionItem.ActionKey, ActionItem.ActionDate, ActionItem.ActionNumber, 
       ActionItem.ActionAltId, ActionItem.DueDate, ActionItem.RestrictToUser, 
       ActionItem.ActionCompleteDate, ActionItem.StatusKey, 
       ActionItem.AssignByUserKey, ActionItem.CategoryKey, 
       0 AS ActionAssignToKey, ' ', ' ', ' ', 0, 0, 0, ' ', ' ', ' ', ' ', 
       ActionUsers.FirstName AS ActionUserFname, 
       ActionUsers.lastName AS ActionUserLname, ' ', ' ' 
FROM ActionItem, ActionStatus, ActionCategory, users ActionUsers 
WHERE ActionItem.ActionKey NOT IN (select ActionAssignTo.ActionKey from ActionAssignTo) AND 
      ActionItem.StatusKey = ActionStatus.StatusKey AND 
      ActionItem.CategoryKey = ActionCategory.CategoryKey AND 
      ActionItem.AssignByUserKey = ActionUsers.UserKey AND 
      ActionItem.AssignByUserKey = 17 
ORDER BY 1, 11
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform