Results 1 to 5 of 5
  1. #1
    Fluvio is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    2

    Show absolute values

    Hello,

    I want to filter for Value1 if a value is between to dates, for
    example: 14.06.2010 and 01.07.2010 and Value1= Base1
    Then it should show the absolute number of Value2, in that case
    3.

    Value1 | Value2
    ---------------
    Base1 0815
    Base1 1121
    Base1 4711



    I doesn't display the expected values, but the following:

    Value1 | Value2
    ---------------
    Base1 0815
    Base1 1121
    Base1 4711
    Base1 4711

    I tried it with the Group by functionality in a query, but that is not what I wanted to see. Is there any possibility to display the absolute values?

    Thank you for help

    Fluvio

  2. #2
    ryan1313 is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    20
    I'm confused, I've always thought that the absolute value is a number's position in relation to 0, in other words the absolute value of both 3 and -3 is 3 since they are both 3 positions away from 0.

    Are you wanting a record count of how many records come between two dates?

  3. #3
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    select value1,abs(value2) from TableName where ([date-1] between #14.6.2010# and #1.7.2010#) and value1 ="Base1"

  4. #4
    Fluvio is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    2
    @ryan1313:

    Sorry, I actually mean a record count, but it doesn't work properly,

    I tried it the following two queries:

    Query1
    SELECT Table1.Value1, Table1.Value2
    FROM Table1
    WHERE (((Table1.Date) Between #1/1/2010# And #12/31/2010#))
    GROUP BY Table1.Value1, Table1.Value2;

    Query2
    SELECT Query1.Value1, Count(Query1.Value2) AS CountOfValue2
    FROM Query1
    GROUP BY Query1;

    It shows me the right Values based on my Table in #1

    That doesn't work (Error message "Error in [Created at]"):

    strKrit = "[Value1] = 'Base1' And [Created at] > " & strDate1 & " And [Created at] <" & strDate2
    Me.txtTest = DCount("*", "Query2", strKrit)

    I just want to see the 3 values, not as double value (then I would have 4)

    Value1 | Value2
    ---------------
    Base1 | 3

    Can anyone help?

    @weekend00: Thank you for your help, but it didn't work
    --> Error in syntax Date

    Fluvio

  5. #5
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    another opinion:

    you are not specifying what the number 3 means. where does that come from? is that the record # you want? is that an average? it really is not at all related to the records (value2) that you used in your example. however, if you want duplicates eliminated from a record list in a query, this is probably what will work:
    Code:
    select distinct field1, field2
    
    from table
    
    where datefield between #date1# and #date2#

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

Similar Threads

  1. Query, show top 10
    By lostinspace in forum Queries
    Replies: 4
    Last Post: 05-10-2010, 12:18 PM
  2. Replies: 3
    Last Post: 04-04-2010, 05:26 PM
  3. Replies: 1
    Last Post: 03-27-2010, 06:13 AM
  4. Absolute Beginner Help
    By jonesbp in forum Access
    Replies: 1
    Last Post: 08-17-2009, 08:23 PM
  5. Show some or all
    By protean_being in forum Queries
    Replies: 1
    Last Post: 05-28-2008, 05:33 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