amishraa 0 Junior Poster in Training

My apologies for posting Teradata question on MS SQL thread due to there not being one for TD.
I am trying to get last 3 months of data but running across an error using month(current date - interval '3' month) because it uses current date to determine previous months and causes issue when trying to determine the month of February due to its shorter calendar days.
month(current_date - INTERVAL '1' MONTH) provides data for last month
How do I pull February data because it will give an error with INTERVAL '1' MONTH

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.