Home › Forums › kdb+ › Selecting date from table › Re: Selecting date from table
-
How did you create the table? Did you load it from a CSV or similar file? You might want to open it in a hex editor because you might have invisible special characters in there. The clue is that the vertical bar on the line of TRADE_DT is further to the left than for the other columns – q takes the length of the column name in bytes to find where to draw that line, and if there are invisible characters, those will shorten the actually printed width of the name, resulting in the line appearing to the left. The same occurs if you have a UTF-8 input file where some characters are represented by a different number of bytes than the number of character slots they take up on the screen. However such characters are not recommended for use in column names because then you can’t use a select query.
As a quick fix you could use .Q.id on the table which will transform all column names into valid identifiers by removing all invalid characters. However if the source file is used by other applications, they could also run into a similar issue so it might be worth investigating if there is anything wrong with it.