Counting records according to their date range

Database

Counting records according to their date range

Hi Guys

Total newbie here.

I am trying to learn teradata and struggling with some basic SQL. I've had experience in a few other db's in the (sort of distant past) but Teradata's syntax is throwing me off a bit.

I'd like to count the number of records which has a date field between MM/DD/YYYY and MM/DD/YYYY. Self incrementing would be my next step but I only have read access to a few views so I don't know if its possible.

Can you some put me in the right direction please?

Thank you!

1 REPLY
Senior Apprentice

Re: Counting records according to their date range

Something like this?

select count(*) 
from tab
where datecol between date '2012-01-01' and date '2012-12-31'

Dieter