Skip to main content
November 30, 2006
Question

TimeStamp: Coldfusion V MSSQL

  • November 30, 2006
  • 1 reply
  • 298 views
I've got a mssql database with records that have been timestamped using coldfusions #now()#.

How do I go about running a cfquery to get the last 12 months of records???

In other circumstances the following statement would suffice

WHERE entryDate >= DATEADD (yyyy , -1, GETDATE()

Not sure how to tackle this one.
This topic has been closed for replies.

1 reply

Participating Frequently
November 30, 2006
the DATEDIFF() function is probably the easiest option:

WHERE DATEDIFF(m, entryDate, GETDATE()) <= 12

cheers.