Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exclude In Count after a Date

Status
Not open for further replies.

thefox149

Technical User
Nov 22, 2004
158
AU
I am quite confused about this any help would be greatly appreciated

I have raw data that does not contain any state data but has user ID's

I maintain a user table that allows me to write queries

tblUsers
UserID State Team
ABS NSW Motor
DEF QLD Home
SET NSW Home

tblRawData
My Raw Data
UserID Sales

Query is easy
SELECT Sum(SALES) FROM tblRawData INNER JOIN tblUsers ON [tblCaseloads].[User ID]=[tblUsers].[USERID]
Group By Blah blah blah

However sometimes the users change teams so I want to add a column to my users id call exclude date. The results of that person should not be counted after a date

but how how can I count the data

SELECT Sum(SALES) FROM tblRawData INNER JOIN tblUsers ON [tblCaseloads].[User ID]=[tblUsers].[USERID]
Group By Blah blah blah
Where Something here...
 
Hopefully you have a date field in tblRawData (tblCaseloads ?) ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top