Jump to content

Recommended Posts

what have you tried? because the fun part of programming is in actually seeing code that you wrote produce the result that you want.

 

your dates should be in a yyyy-mm-dd format (with leading zeros in the mm and dd) so that you can sort them. if you want to display them as m/d/yyyy, you would do that when you display the results.

 

i would loop over the result (which should be sorted by the country name to give output in the order that you want) from your database query and produce two arrays. the first array gets all the dates. the second multi-dimensional array holds the data, using the country as the index for the first dimension, the date as the index for the second dimension, and the total as the stored data value.

 

use array_unique() on the first array, then sort that resulting array. this will produce an array of unique dates in ascending order for producing the heading and for accessing the data under those headings.

 

to produce the result, loop over the second array's first dimension (country), outputting the country name as the label for the row each time it changes. then, loop over the first array, and use each date to access the data, if any, for the current country for that date. if there isn't a value, output whatever indication you want (0, ----, n/a, blank). if there is a value, output the value. repeat for all countries being looped over.

Edited by mac_gyver

Hi,

 

Thanks for all you responce, and i have new problem, i cant get current month and im using by the way, ODBC connection and using access 79 DB.

WHERE Date between '8/1/2015' and '8/30/2015'

but stil cant get all the date between.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.