BTeq date issue

Tools
Enthusiast

BTeq date issue

Hi,

I am having an issue when using Bteq in Linux. 

Let's say I have a table in teradata that has two columns:

Article            Date_issue

 Article1         12/18/2013

When I qu ery this table from Bteq in Linux the result is:

Article            Date_Issue

Article1          13/12/18

Is there a way to get the date format correct just like it exist in the table?

3 REPLIES
Senior Apprentice

Re: BTeq date issue

A DATE doesn't have a format, it's just formatted for display, internally it's an integer.

If you run that query in SQL Assistant there's a setting how to format dates, BTEQ doesn't know about that.

To get the desired format you have to specify it in your query::

select date_issue (format 'mm/dd/yyyy') ...
Enthusiast

Re: BTeq date issue

Thank you Deiter.

I was just hoping to show the format that exist in the table without having to format. 

Senior Apprentice

Re: BTeq date issue

What's the existing format?

You can see it when you do a SHOW TABLE or a SELECT FORMAT(tablename.Date_issue);