Results 1 to 2 of 2
  1. #1
    snoopy is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Posts
    53

    Need help for very complicated query inside a report

    Hello lovely Community,

    I urgently need your help. I have one table and I would like to use a sum function for different columns.

    My table
    ...
    column 2012 = 23124
    column 2013 = 1232134214
    column 2014 = 123
    ...



    At a result, function should be show column 2013, because that is maximum. Actually I have totally no idea how i could do this. Therefore I am really happy for any help,
    Last edited by snoopy; 06-20-2012 at 05:43 AM. Reason: figure more out the problem

  2. #2
    snoopy is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Posts
    53
    Ok, wrote my own VBA-Code, because query couldn't deal with those requirement


    Public Function MaxOfColumn(ParamArray Values()) As Variant
    Dim vItem As Variant
    Dim vMax As Variant

    vMax = Null
    For Each vItem In Values()
    If Not IsNull(vItem) Then
    If vMax >= vItem Then
    Else
    vMax = vItem
    End If
    End If
    Next vItem
    MaxOf = vMax
    End Function

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

Similar Threads

  1. Query with Complicated Requirements
    By Briana in forum Queries
    Replies: 1
    Last Post: 06-13-2012, 08:05 PM
  2. Complicated Query (Interleave rows?)
    By crozfader in forum Queries
    Replies: 8
    Last Post: 09-19-2011, 12:15 PM
  3. TimeDiff calculations inside Query.
    By cap.zadi in forum Queries
    Replies: 1
    Last Post: 09-15-2011, 09:27 AM
  4. Filtering and using First() inside a query
    By Gilligan in forum Queries
    Replies: 17
    Last Post: 03-10-2011, 05:52 PM
  5. Complicated Query needs some date range help
    By KevinMCB in forum Queries
    Replies: 1
    Last Post: 01-11-2011, 12:25 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