Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2011
    Posts
    1

    Unanswered: Excel to Access Question

    I have a problem that I was hoping to get some help from. I have the expression written in Excel but I want to do the same thing in Access. The Excel Expression is as follows;
    =IF(IF(G$1>=Master_Shape!$Q122,AND(G$1<=Master_Sha pe!$R122)),-VLOOKUP(G$2,SP!$E$2:$H$857,3),0)

    Which basically looks up one date in a column and if that date is less than the start date in another column it returns zero. If the date is equal to or greater than the start date it returns a pumping value until it reaches a stop date and then again returns a zero value. The pumping rate returned is for the month that the if statement is looking at. Can anyone help me with this? If was basically think I need to use a If-Then-Else Statement and probably a Dlookup, is that the right logic? Thanks!

  2. #2
    Join Date
    Oct 2003
    Location
    London
    Posts
    341
    It would be a little easier to understand if you were able to provide your excel sheet, and possibly the database that you're working on.

    I think I can do what you are asking for but it depends on how your tables are structured in your database. It looks like you have 4 sets of information that you are looking up.

    Where are you putting the answer to the above statement?

  3. #3
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,420
    Provided Answers: 7
    It's much the same

    Iif([feildname]<[feildname],true,false)

    Query does not have and() so you have to have iif() again then you just have to change the vlookup to dlookup([lookupfeildname],[table name],[feildname]=crit)

    Or you could write a vb function put it into a module then call that in the query
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •