<html>
<head>
</head>
<body>
<!--- Loop back 30 days from today --->
<cfloop index="d" from="1" to="30" step="1">
<cfset myDate = "#dateFormat(dateAdd('d', -(d-1), now()), 'yyyy-mm-dd')#" >
<!--- pull data from the "myDate" value --->
<cfquery name="getViews" datasource="#request.dsn#" username="#request.dsnUsername#" password="#request.dsnPassword#">
SELECT days, views
FROM site_views
WHERE days = '#myDate#'
</cfquery>
<!--- An example of a formatted input value for "days" : 2011-10-20 23:44:24 --->
</cfloop>
I'm trying to output my data into 2 separate lists.
List 1: Days starting from beginning of 30 days ago.. = '2011/10/25', '2011/10/24', '2011/10/23',... '2011/11/06' (last 30 days worth)
List 2: The views and if there isn't any value for "days" meaning there were no views then it would = '0' but the overall list would be...
0, 1, 5, 6, 7.... 9 (last 30 days worth)
</body>
</html>
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE