# Bug in csv response of Traffic Volume API

**URL:** https://opendataforum.transport.nsw.gov.au/t/bug-in-csv-response-of-traffic-volume-api/2005
**Category:** Uncategorized
**Created:** [May 14, 2020, 12:43am UTC](https://opendataforum.transport.nsw.gov.au/t/bug-in-csv-response-of-traffic-volume-api/2005 "2020-05-14T00:43:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rowanwins](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@rowanwins](https://opendataforum.transport.nsw.gov.au/u/rowanwins)
#### Post date: [May 14, 2020, 12:43am UTC](https://opendataforum.transport.nsw.gov.au/t/bug-in-csv-response-of-traffic-volume-api/2005/1 "2020-05-14T00:43:36Z")

</div>

I’m sending a query to the road\_traffic\_counts\_hourly\_permanent table requesting a csv back with a large number of columns back

```auto
  params: {
      format: 'csv',
      q: `
        SELECT
        hour_00,hour_01,hour_02,hour_03,hour_04,hour_05,hour_06,hour_07,hour_08,hour_09,hour_10
        FROM road_traffic_counts_station_reference REF
      JOIN road_traffic_counts_hourly_permanent SUMM ON REF.STATION_KEY=SUMM.STATION_KEY
      WHERE YEAR='2019'
        AND STATION_ID='33023'
        AND DAY_OF_WEEK IN ('1', '2', '3', '4', '5')
         `
  }

```

If you request more than 10 columns in my SELECT then the ordering of the columns in the CSV goes whacky. For example the response to the above is

```auto
hour_05,	hour_00,	hour_02,	hour_03,	hour_04,	hour_01,	hour_06,	hour_07,	hour_08,	hour_09,	hour_10

```

Notice that hour\_05 is the first column.

If I request 1 fewer columns then it works fine.

All the data appears however it’s just kind of annoying 🙂

Thanks,  
Rowan
