Avatar of ac_davis2002
ac_davis2002
Flag for United Kingdom of Great Britain and Northern Ireland asked on

select full 12 months data

Hi

I have been given the solution by e/e to select 12 month appointments from my appointments table

Select * from TBLAppointments
where AppointmentDate > dateadd(m,-12,getdate())

this is good but if i run it it gives me all appointments from today 14/03/2012 back to 14/03/2011, how can i tweak it so it gives me data back from today to 01/03/2011...i need the full previous month also?

Thanks
Microsoft SQL Server 2008Microsoft SQL Server 2005

Avatar of undefined
Last Comment
Simone B

8/22/2022 - Mon
SOLUTION
jogos

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
jogos

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Simone B

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Your help has saved me hundreds of hours of internet surfing.
fblack61