get more records of 30 days from the date of the day

I use MS SQL 2000 How can I recover the data that are older than 30 days from the date of the day? I put currendate "DateTime" field as data type and length is the '8 '.

< cfset variables.getdate = DateAdd (would be ',-30, now()) >

Select dataname
of tabletest
where currendate > = "variables.getdate."

the sql stmt above does not work.

Select dataname
of tabletest
where currendate<= #createodbcdate(dateadd("d",="" -30,="">

You say that you want records which are more than 30 days from now, so that it must be less than or equal to the date
But if you want the Chronogram of 30 days there are until now then it must be greater than or equal to

Ken

Tags: ColdFusion

Similar Questions

Maybe you are looking for