Results 1 to 8 of 8
  1. #1
    EcologyHelp is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2015
    Posts
    16

    Query Expression for Evaluating a Large Field of Data

    I have received some very good feedback from this site before and want to thank all of you for that. I have another problem that I am stuck on and wanted to see if anyone out there has some thoughts on how to approach this question.
    Click image for larger version. 

Name:	Hydro Veg1.PNG 
Views:	8 
Size:	69.7 KB 
ID:	22822Click image for larger version. 

Name:	Hydro Veg2.PNG 
Views:	8 
Size:	32.3 KB 
ID:	22823

    In the above pictures I have portions of a query that I am working through. The really important fields in the data sheet are the fields that contain OBL, FACW, FAC, FACU, and UPL, more specifically the left hand column in each pair. The other important field is the last one in the second picture that is titled Hydrophitic, the full title is Hydrophitic Veg (and yes I realize that it is misspelled, late night last night). What I am trying to accomplish is to have Access go through each line and evaluate if the # of OBL + FACW > FACU + UPL the Hydrophitic Veg = true and if # of OBL + FACW < FACU + UPL the Hydrophitic Veg = False. I am wondering if this is at all possible so in the future I or somebody else working with this data won't have to do it by hand.

    Thanks again for your time.

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I think it is doable, but I am confused on what you are adding/ comparing. When you say OBL, are you counting the number of occurances of OBL, or are there numbers in a different field you want to add?

    In the second picture, I see the second record has the field Hydrophitic equal to TRUE (-1). How did you get the -1?
    Maybe an example would help.

  3. #3
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    I see the second record has the field Hydrophitic equal to TRUE (-1). How did you get the -1?
    fyi true/false can also be represented as -1/0 numerically (tho' in most other db systems it is 1/0)

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by Ajax View Post
    fyi true/false can also be represented as -1/0 numerically (tho' in most other db systems it is 1/0)
    Yep, knew that. That is why I had TRUE (-1).... maybe I should have used TRUE/(-1). I was asking how the TRUE/(-1) was calculated.

  5. #5
    EcologyHelp is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2015
    Posts
    16
    I had previously calculated by hand the true/false values, but that seems impractical for anyone updating the database after me. I am trying to write in an expression that will auto update the hydrophytic value for future users. Needless to say my Access skills are quite low and I am out of my league with this one.

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I had previously calculated by hand the true/false values,
    Again, HOW did you /do you calculate the values?

    Pretend that you are teaching me to take over for you. Describe the calculation process.

  7. #7
    EcologyHelp is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2015
    Posts
    16
    So there are five statuses OBL, FACW, FAC, FACU, UPL. The two columns of represent two different regions so we are only interested in the one that has GP not WMVC. As you go across the line of data OBL = 1 and FACW = 1 FAC = 0 and FACU = -1 and UPL = -1. When you add then up if you have a positive number the hydrophitic field is marked as true, if you have a negative number it is marked as false (-1/0). An alternated way of looking at it is if the number of occurrences of OBL and FACW is greater then FACU and UPL the it is marked as true.

  8. #8
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    OK, better.


    The two columns of represent two different regions so we are only interested in the one that has GP not WMVC
    Now, what are the actual field names that you look at to check for the statuses? I see only 1 field name: "WSPZ1_GP_SP"


    Next question: What is the SQL of the query as you have it now?

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

Similar Threads

  1. Replies: 1
    Last Post: 07-24-2014, 08:35 PM
  2. Replies: 5
    Last Post: 05-14-2012, 02:01 PM
  3. Iif Expression in Query from Time Field
    By SpdRacerX in forum Queries
    Replies: 1
    Last Post: 03-21-2012, 12:59 PM
  4. Replies: 1
    Last Post: 02-26-2009, 11:31 AM
  5. Field gets data from Expression?
    By Willot in forum Access
    Replies: 3
    Last Post: 12-10-2005, 06:28 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