Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 27 Mar 2006 @ 09:29:22 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Valid criteria that returns zero rows
 
From:   McCall, Glenn David

First of all, I don't think Teradata 7 has been released yet (unless you are on some sort of really early release program :-) ). V2R6.2 is scheduled for release soon.

You can find out your version of Teradata using the following query:

     select * from dbc.dbcinfo;

It always has 2 rows and everyone should be able to run it. Mine says:

     RELEASE    V2R.06.00.00.03
     VERSION    06.00.00.03

Which means V2R6.0 (patch level 3)

Now to you your query, it is always risky submitting a rough example. Did you try it first? Did you get the same inconsistent results?

I had a go, and both forms seem to work for me. Here is my SQL. I'm submitting it so you can try it too.

     create table tbl (id decimal (18), dt date)
     insert into tbl (123, date);
     insert into tbl (456, date);
     insert into tbl (789, date);
     insert into tbl (111, date - 1);

     select * from tbl;     /* I do this so I can see what the actual date
     is */
     select *
     from tbl
     where dt = ('27/03/2006' (date, format 'dd/mm/yyyy'));

this returns 123, 456 & 789

111 is omitted because it has yesterdays date.

NB: I had to use a 4 digit year in my query. This is always a good idea because then you can be sure what you will get. A 2 digit year (eg. 06) may default to 1906 (as it does on my system).

Now modify the query to:

     select *
     from tbl
     where dt = ('27/03/2006' (date, format 'dd/mm/yyyy')) and
        id in (123,456,789);

This still returns 123, 457 & 789.

I hope this helps, let us know how you get on

Glenn Mc


P.S. My ODBC is 3.04 as well.



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023