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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Must Have a 1 or 2

Status
Not open for further replies.

TJVFree

Technical User
Nov 22, 2010
236
US
I'm trying to find a way that I can make Access find number 1 or 2 in a column then add any other numbers that would match the record number -60 days for Referral Date

Column “Coll#” must have a 1 or 2 but then also let me the other numbers that are in that column

I guess another way of saying it would be that callous Cull# must contain a 1 or a 2 than any other numbers that are in the coll# column.
I how this isn’t too confusing.

Thank you for your help

Code:
SELECT [PSB Accout Linkingqry].SocialSec AS [SS#], [PSB Accout Linkingqry].RecordNumber AS [Record#], [PSB Accout Linkingqry].FirstName, [PSB Accout Linkingqry].LastName, [PSB Accout Linkingqry].StAddress1 AS [St Address], [PSB Accout Linkingqry].City, [PSB Accout Linkingqry].Remark, [PSB Accout Linkingqry].Phone, [PSB Accout Linkingqry].Employment, [PSB Accout Linkingqry].ClientNumber AS [Client#], [PSB Accout Linkingqry].ClientName, [PSB Accout Linkingqry].CollectorNumber AS [Coll#], [PSB Accout Linkingqry].TEXT1 AS Region, [PSB Accout Linkingqry].DateOfReferral, [PSB Accout Linkingqry].StatusCode AS Status, [PSB Accout Linkingqry].PrincipalBalance AS Balance
FROM [PSB Accout Linkingqry]
WHERE ((([PSB Accout Linkingqry].SocialSec) In (SELECT [SocialSec] FROM [PSB Accout Linkingqry] As Tmp GROUP BY [SocialSec] HAVING Count(*)>1 )) AND (([PSB Accout Linkingqry].DateOfReferral)>#12/1/2014#))
ORDER BY [PSB Accout Linkingqry].SocialSec, [PSB Accout Linkingqry].CollectorNumber;


TCB
 
There are words missing from your sentences... It isn't clear to me if you are trying to change data in your table or make a query that displays different data.

If the latter perhaps the IIF function will help. Just a guess as I'm not clear what things are supposed to look like in the end.

Maybe you want something like this?
IIF ([PSB Accout Linkingqry].CollectorNumber Between 1 and 2,[PSB Accout Linkingqry].CollectorNumber + 60,[PSB Accout Linkingqry].CollectorNumber) as Col#
 
Do you want to know who is due for a reminder to be sent or change their record to their next reminder date once they have received the service? Or perhaps both?

If you want to just change the value maybe you could use an update query where the columns are between 1 and 2 to the new calculated value you want?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top