Results 1 to 5 of 5
  1. #1
    Bob Blooms is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2012
    Location
    FL and New England
    Posts
    19

    Expression not working in query

    Click image for larger version. 

Name:	QueryQuestion.jpg 
Views:	8 
Size:	110.0 KB 
ID:	8952

    Attempting to forescast the values of salary increase for individuals who will receive step increases during the fiscal year. The trigger is a Salary Consideration Date (Sal Con Date). I have been able to calculate the percentage of the year that the indivudal will have the new salary. By problem is getting the next step for their respective job classification (JobClass). I thought I could simply and 1 to their current step which is in the query. No luck, as the screen shot shows!

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    Please describe in more detail.
    Show the query SQL.

    The error message is pretty clear - at least where to start looking.

  3. #3
    Bob Blooms is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2012
    Location
    FL and New England
    Posts
    19
    Looked at the query SQL. I think I understand the SELECT statement (had a flash back to my COBOL days) and FROM statement, and the filter WHERE statement. What I cannot do is but the logic together to find the error.

    SELECT tblCS3Compilation.Name, tblCS3Compilation.JobClass, tblCS3Compilation.Step, tblSalaryTables.Salary, tblCS3Compilation.[Sal Con Date], DateDiff("d",[Sal Con Date],41455) AS LagTime, [lagtime]/365 AS StepIncreasePeriod, [Step]+1 AS [New Step]
    FROM tblCS3Compilation INNER JOIN tblSalaryTables ON (tblCS3Compilation.Step = tblSalaryTables.Step) AND (tblCS3Compilation.JobClass = tblSalaryTables.JobClass)
    WHERE (((tblCS3Compilation.[Sal Con Date])<>0));

  4. #4
    Bob Blooms is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2012
    Location
    FL and New England
    Posts
    19
    I found my error. I needed to add [table.Step]

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    I tried the part of your query I could decpher from the diagram, and using the database I sent you previously, tried the followinr
    (it doesn't have all your output fields)

    Code:
    SELECT [CS-3Compilation].Name, [CS-3Compilation].JobClass, [CS-3Compilation].Step, SalaryForJobClassLevels.Salary, [CS-3Compilation].[Sal Con Date], (select JobLevel +1 as NextStep from SalaryForJobClassLevels   NX  where JobClass =SalaryForJobClassLevels.JobClass and JobLevel =SalaryForJobClassLevels.JobLevel) AS Expr1
    FROM [CS-3Compilation] INNER JOIN SalaryForJobClassLevels ON ([CS-3Compilation].Step = SalaryForJobClassLevels.JobLevel) AND ([CS-3Compilation].JobClass = SalaryForJobClassLevels.JobClass)
    WHERE ((([CS-3Compilation].[Sal Con Date])<>0));

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Query Expression Help
    By hmartin in forum Queries
    Replies: 7
    Last Post: 01-21-2012, 11:37 PM
  2. Query Expression
    By nizam in forum Queries
    Replies: 1
    Last Post: 11-12-2011, 02:56 PM
  3. Replies: 2
    Last Post: 10-02-2011, 01:27 PM
  4. Expression for Query Help
    By fikeplay in forum Access
    Replies: 1
    Last Post: 07-09-2011, 05:12 PM
  5. Query expression for form
    By pjacob in forum Forms
    Replies: 1
    Last Post: 10-10-2006, 09:12 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums