Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: Is using current date and dateAdd the best way to show 30 days worth of records .

$
0
0

I could not get your codes to work. If I Just used the following code:

 

<cfquery name="GetDevotional" datasource="#application.database#">

SELECT dev_id, display_date, title, scripture, body

FROM devotional

where display_date BETWEEN '#dateFormat(now(), 'MM/DD/YYYY')#' AND '#DateFormat(DateAdd( 'd', 30, now() ),'MM/DD/YYYY')#'

</cfquery>

 

When I output the display date in a list, I get 3 different sets in multiples of 30:

 

  1. 01/17/2013 through 02/15/2013
  2. 01/16/2014 through 02/15/2014
  3. 01/16/2015 through 02/14/2015

 

So, it is adding the 30 days to the 16th, but does not display only the current year, but is displaying 30 days for the three years that are listed in the database.


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>