Results 1 to 2 of 2
  1. #1
    kawalkar.hemant is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2016
    Posts
    1

    Angry MS Access - SQL Query Date wise with selection of column summarized value

    Below is my source Data



    Click image for larger version. 

Name:	Source.png 
Views:	8 
Size:	7.1 KB 
ID:	26316

    by using below query I can get summarized data for '17-09-2016'
    SQL Query :-
    SELECT key_val.A, key_val.B, key_val.C, key_val.D, Sum(IIf(key_val.Store_date=#9/17/2016#,key_val.Val,0)) AS [17-09-2016]
    FROM key_val
    GROUP BY key_val.A, key_val.B, key_val.C, key_val.D;

    but I am looking output suppose to look like this way.

    Click image for larger version. 

Name:	output.png 
Views:	8 
Size:	11.1 KB 
ID:	26317

    Specifically= I need summarized data for column a,b,c and for '17-09-2016' dateIn excel we will apply sumifs formula to get desired output but in Access - SQL I am not getting how to form the query to get the same data.

    Can any one assist me how to achieve above result by using Access Query?

    Specifically= I need summarized data for column a,b,c and for '17-09-2016' date

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    first, your data looks like an excel spreadsheet and not a table. Excel and Access work in completely different ways and store their data differently. So any querybased on 'excel' style data will be much more complex and possibly not doable.

    it would help if you used real names, or at least more meaningful ones and your description matched the data. Are A, B C etc store names or product names perhaps? Why does your code have columns A-D but your text only refer to a-c? why does the second row of your result show a value of 34 and also have the last two rows when the filter is supposed to be 17-09-2016 and your data shows later dates?

    Remember we know nothing of your business and can only go by what your write - which at the moment raises more questions than it answers.

    Suggest explain in simple English what you are trying to do, what the data means and what the result is you require.

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

Similar Threads

  1. Replies: 4
    Last Post: 12-29-2015, 03:25 PM
  2. Replies: 2
    Last Post: 05-19-2013, 06:03 AM
  3. Replies: 3
    Last Post: 09-19-2012, 08:59 AM
  4. Replies: 0
    Last Post: 07-16-2012, 01:48 PM
  5. minus date wise sales a=n?
    By alex_raju in forum Access
    Replies: 1
    Last Post: 07-30-2011, 01:23 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