14 Replies Latest reply on Jan 17, 2014 8:55 AM by Carl Von Stetten

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


      I want to display files from the day a viewer logs in, through the next 30 days. I tried the code below but it does not work. What am I doing wrong?


      <cfoutput><cfset mydatetime=#now()#></cfoutput>


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

      SELECT display_date, title

      FROM mobile

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