Filter blank date field in the format string

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc

Poston Fri, 02 Sep 2016 4:01 pm

Hey guys, okay?

Need some help, I fished on several sites, but I can't find the solution.

I have little experience in sql and had never worked with oracle. Work with the BI tool Tableau and at the moment I am in a job where the Bank used by the company's Oracle 11 g.
The tableau does not need to work with sql directly, just select the Bank, I have a list of tables and drag them to the screen and make the relationship of them just by clicking on the keys, something really easy.
But now I have a problem because when you use the date field to build my worksheets and charts, this date comes from the Bank in the field of characters in the format e.g. 20160902 = 9/2/2016 in the can turn that tableu characters into a date field, the problem is that at the Bank this column of data in a given table has some fields that are blank or with a space because the date only filled when there is movement of any stock item. So the problem is to turn the date which is the date string field tableau presents an oracle error that invalid year, rightfully exist blank dates.

How can I filter these dates blank? I searched the net and found a hint to use the DECODE function, but it didn't work. In the Tableau have the option of generating the sql code of the relationship of the tables that I'm using, if you think you can help post the sql, but I think the amount of lines to post here, but if it's okay I post.

I appreciate if you can help me.

Poston Fri, 02 Sep 2016 4:29 pm

Hello, before sending the select tries to use the replace replace (campo_data, ' ', ' ') if it doesn't work and the select is very large, saved in a .txt file and attaches the message.
Location: São Paulo - SP

Return to SQL

Who is online

Users browsing this forum: No registered users and 3 guests