Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476

    What's wrong with this expression in a query?

    In a query I have:

    - MNTH/YR (The month & year)
    - PROJECTID
    - HRS (number)
    - PTERNGS: Sum([HrlyBllng]*[HRS]) (Expression)
    - PTPRFT: SUM[SumHrlyBllng]*.6] (Trying to create Expression)



    I want to see my Profit 6% on every ProjectID

    If I cannot perform this within the same query how do I figure out my profit?

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    This

    PTPRFT: SUM[SumHrlyBllng]*.6]

    would need to be changed to

    PTPRFT: SUM([HrlyBllng]*[HRS]*.6])

    or you would need to not have that field in your query and then use this query in another one where you can then create this new field. You can't use an ailias for a calculated field in another calculation within the same query.

  3. #3
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    Does not compute.

    Quote Originally Posted by djclntn View Post
    In a query I have:

    - MNTH/YR (The month & year)
    - PROJECTID
    - HRS (number)
    - PTERNGS: Sum([HrlyBllng]*[HRS]) (Expression)
    - PTPRFT: SUM[SumHrlyBllng]*.6] (Trying to create Expression)
    Does the .6 above have something to do with 6% profit? Are you wanting Sum([HrlyBlling]*[HRS]*0.06)?

    I want to see my Profit 6% on every ProjectID

    If I cannot perform this within the same query how do I figure out my profit?
    __________________________________________________ ________________
    Let me restate: For any record, does [HrlyBllng]*[HRS]*0.06 give you the target profit for that project?

  4. #4
    stevepcne is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2011
    Location
    Boston, Ma.
    Posts
    23
    "I want to see my Profit 6% on every ProjectID"
    when you say you want to see your profit do you mean the markup value or just the profit sum?
    maybe *1.06 would work.

  5. #5
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    What is a, "markup value?"

  6. #6
    stevepcne is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2011
    Location
    Boston, Ma.
    Posts
    23
    a markup value is when you buy a product for $10.00 and want to mark it up 40% you would charge $14.00, $10.00 *1.4

  7. #7
    stevepcne is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2011
    Location
    Boston, Ma.
    Posts
    23
    maybe this will work ptprftsum:[sumhrlybllg]*1.06 - [sumhrlybllng]

  8. #8
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    Ok,, Let's say I have 4-Projects in which I work on billing them different $-amounts(per hr) & next month I want to do a 20% markup for all of my Projeects across the broad b-- how can I accomplished this tasks?

    To be fair here, I'm a beginner learner with Access. It really interest me, but I greatly struggle in many ares with understanding -- particulary with relating tables & assigning P-Key & F-keys. I spend countless hours watching tutorial videos & read about relating tables, but frustrating as it is it's not "clicking" with me which is so pissing me off with myself!

    Anyway, in doing a markup with what I wrote above does it involve doing an append queury? I sort of recall watching it being done in a video...

  9. #9
    stevepcne is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2011
    Location
    Boston, Ma.
    Posts
    23
    i would suggest making a column named markup% and use it with your calculated fields

  10. #10
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    In the Table or in a query?

  11. #11
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    Here's another question-

    If I do a 10% markup on my Projects hourly rate how do I configure it to begin (or change) at a certain time (Date)? How do I write an expressing for a 10% markup effective 12/1/2011?

  12. #12
    stevepcne is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2011
    Location
    Boston, Ma.
    Posts
    23
    you can use parameters in your query, something like =iif([datefield]>=12/1/2011,[project]*1.10,[project]*[markup%])

  13. #13
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by stevepcne View Post
    you can use parameters in your query, something like =iif([datefield]>=12/1/2011,[project]*1.10,[project]*[markup%])
    Steve: If you have dates you need to use Octothorpes.

    =iif([datefield]>=#12/1/2011#,[project]*1.10,[project]*[markup%])

  14. #14
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    But I would NOT be hard coding in dates like that. If you have things that are going to change, put them in a table and pull the data when you need it. So you can either store the percent with the record or you can use a method like this sample:
    http://downloads.btabdevelopment.com...ileageRate.zip
    which stores EFFECTIVE DATES and then applies the value based on the date of the item using the value that was valid for that date range.

  15. #15
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    Thanks!

    I have so many things happening right now I'm actually working on this particular task at the moment so I may be posting again at a later time. Thanx again!

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. What's wrong with my query?
    By Grek in forum Queries
    Replies: 2
    Last Post: 10-31-2011, 12:12 PM
  2. Expression gives wrong results
    By newtoAccess in forum Queries
    Replies: 22
    Last Post: 12-03-2010, 12:21 AM
  3. What's wrong with this query?
    By jsoldi in forum Queries
    Replies: 2
    Last Post: 10-11-2010, 07:45 AM
  4. Query for latest date? what am I doing wrong?
    By Overdive in forum Queries
    Replies: 1
    Last Post: 12-18-2009, 06:04 AM
  5. What's wrong with this expression
    By tallroger in forum Access
    Replies: 1
    Last Post: 05-05-2009, 04:00 PM

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