troubleshooting Question

Query Year in TeraData

Avatar of Leo Torres
Leo TorresFlag for United States of America asked on
* TeradataSQL
10 Comments1 Solution84 ViewsLast Modified:
Hello this is a really easy question be but please understand this is the first time I write SQL TeraData code. I need to select data between years, and I do not want to use '1993-01-01' format I want an integer in this case 1993
For example my query will be something like this

Select * 
from dbo.SomeTable
Where Year(Date_Field) between 1993 and 1998

Open in new window

Date_Field is of type "DATE"
I just learned the hard way the YEAR() function does not exists in TeraData. This is the way I would do it in MS SQL. Any help as to how I can run this same query in Teradata
Join our community to see this answer!
Unlock 1 Answer and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros