MATLAB: Does the FETCH function in the Datefeed Toolbox 2.0 (R2007a) for the Kx database not handle the returned table with primary key

databaseDatafeed Toolboxkeykxnotprimaryreturned

I am trying to use the FECH function to retrieve data from the Kx database. In the retrieved data, the primary key field "date" is not present. I used the following code to retrieve the data:
% A Q server hosting a TAQ database
c = kx('scsettldap09.bankofamerica.com',50007)
% The "by" clause makes "date" be a primary key
% This field is missing from the returned structure
r1 = fetch(c,'select n:count i by date from trade where date>2007.08.01,sym=`FLIR')

Best Answer

This enhancement has been incorporated in Datafeed Toolbox 3.1 (R2008a). For previous product releases, read below for any possible workarounds:
This ability to include the primary key in the table is currently not available in the Datafeed Toolbox 2.0 (R2007a).
As a possible workaround you can ensure that the required data is not handled as a primary key. The syntax would be as follows:
% "0!" drops the primary key, making it a normal column
% Then the "date" field is present in the output
r2 = fetch(c,'0! select n:count i by date from trade where date>2007.08.01,sym=`FLIR')